From eea2c15587cca08210910f86e0881a0d3e8809fa Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 5 Aug 2018 05:32:10 +0000 Subject: [PATCH] Fixed JavaMail session --- app/src/main/java/eu/faircode/email/FragmentAccount.java | 2 +- app/src/main/java/eu/faircode/email/FragmentIdentity.java | 2 +- app/src/main/java/eu/faircode/email/ServiceSynchronize.java | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentAccount.java b/app/src/main/java/eu/faircode/email/FragmentAccount.java index 21cb29f7..bb28338b 100644 --- a/app/src/main/java/eu/faircode/email/FragmentAccount.java +++ b/app/src/main/java/eu/faircode/email/FragmentAccount.java @@ -210,7 +210,7 @@ public class FragmentAccount extends Fragment { // Check IMAP server List 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"); diff --git a/app/src/main/java/eu/faircode/email/FragmentIdentity.java b/app/src/main/java/eu/faircode/email/FragmentIdentity.java index a82eda57..8d1d03a2 100644 --- a/app/src/main/java/eu/faircode/email/FragmentIdentity.java +++ b/app/src/main/java/eu/faircode/email/FragmentIdentity.java @@ -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); diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index e70da9b0..0f3c6b0a 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -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;