diff --git a/app/src/main/java/eu/faircode/email/EmailService.java b/app/src/main/java/eu/faircode/email/EmailService.java index 817a2505b8..3e789f328c 100644 --- a/app/src/main/java/eu/faircode/email/EmailService.java +++ b/app/src/main/java/eu/faircode/email/EmailService.java @@ -127,6 +127,7 @@ public class EmailService implements AutoCloseable { static final int ENCRYPTION_NONE = 2; final static int DEFAULT_CONNECT_TIMEOUT = 15; // seconds + final static boolean SEPARATE_STORE_CONNECTION = false; private final static int SEARCH_TIMEOUT = 90 * 1000; // milliseconds private final static int FETCH_SIZE = 1024 * 1024; // bytes, default 16K @@ -231,7 +232,7 @@ public class EmailService implements AutoCloseable { properties.put("mail.imap.starttls.enable", Boolean.toString(starttls)); properties.put("mail.imap.starttls.required", Boolean.toString(starttls && !insecure)); - properties.put("mail." + protocol + ".separatestoreconnection", "false"); + properties.put("mail." + protocol + ".separatestoreconnection", Boolean.toString(SEPARATE_STORE_CONNECTION)); properties.put("mail." + protocol + ".connectionpool.debug", "true"); properties.put("mail." + protocol + ".connectionpoolsize", Integer.toString(POOL_SIZE)); properties.put("mail." + protocol + ".connectionpooltimeout", Integer.toString(POOL_TIMEOUT)); diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index 4ddb39d849..5180d77a82 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -1568,11 +1568,13 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences new Exception(state.getUnrecoverable())); // Sends store NOOP - EntityLog.log(this, account.name + " checking store" + - " memory=" + Log.getFreeMemMb() + - " battery=" + Helper.getBatteryLevel(this)); - if (!iservice.getStore().isConnected()) - throw new StoreClosedException(iservice.getStore(), "NOOP"); + if (EmailService.SEPARATE_STORE_CONNECTION) { + EntityLog.log(this, account.name + " checking store" + + " memory=" + Log.getFreeMemMb() + + " battery=" + Helper.getBatteryLevel(this)); + if (!iservice.getStore().isConnected()) + throw new StoreClosedException(iservice.getStore(), "NOOP"); + } if (!getMainLooper().getThread().isAlive()) { Log.e("App died");