Browse Source

Fixed JavaMail session

main
M66B 6 years ago
parent
commit
eea2c15587
3 changed files with 5 additions and 5 deletions
  1. +1
    -1
      app/src/main/java/eu/faircode/email/FragmentAccount.java
  2. +1
    -1
      app/src/main/java/eu/faircode/email/FragmentIdentity.java
  3. +3
    -3
      app/src/main/java/eu/faircode/email/ServiceSynchronize.java

+ 1
- 1
app/src/main/java/eu/faircode/email/FragmentAccount.java View File

@ -210,7 +210,7 @@ public class FragmentAccount extends Fragment {
// Check IMAP server
List<EntityFolder> folders = new ArrayList<>();
if (account.synchronize) {
Session isession = Session.getDefaultInstance(MessageHelper.getSessionProperties(), null);
Session isession = Session.getInstance(MessageHelper.getSessionProperties(), null);
IMAPStore istore = null;
try {
istore = (IMAPStore) isession.getStore("imaps");


+ 1
- 1
app/src/main/java/eu/faircode/email/FragmentIdentity.java View File

@ -244,7 +244,7 @@ public class FragmentIdentity extends Fragment {
// Check SMTP server
if (identity.synchronize) {
Properties props = MessageHelper.getSessionProperties();
Session isession = Session.getDefaultInstance(props, null);
Session isession = Session.getInstance(props, null);
Transport itransport = isession.getTransport(identity.starttls ? "smtp" : "smtps");
try {
itransport.connect(identity.host, identity.port, identity.user, identity.password);


+ 3
- 3
app/src/main/java/eu/faircode/email/ServiceSynchronize.java View File

@ -242,7 +242,7 @@ public class ServiceSynchronize extends LifecycleService {
Properties props = MessageHelper.getSessionProperties();
props.put("mail.imaps.peek", "true");
//props.put("mail.imaps.minidletime", "5000");
Session isession = Session.getDefaultInstance(props, null);
Session isession = Session.getInstance(props, null);
// isession.setDebug(true);
// adb -t 1 logcat | grep "eu.faircode.email\|System.out"
@ -658,7 +658,7 @@ public class ServiceSynchronize extends LifecycleService {
return;
Properties props = MessageHelper.getSessionProperties();
Session isession = Session.getDefaultInstance(props, null);
Session isession = Session.getInstance(props, null);
MimeMessage imessage = MessageHelper.from(msg, isession);
ifolder.appendMessages(new Message[]{imessage});
@ -718,7 +718,7 @@ public class ServiceSynchronize extends LifecycleService {
// Create session
Properties props = MessageHelper.getSessionProperties();
Session isession = Session.getDefaultInstance(props, null);
Session isession = Session.getInstance(props, null);
// Create message
MimeMessage imessage;


Loading…
Cancel
Save