Browse Source

Prevent failed to create new store connection exception

main
M66B 6 years ago
parent
commit
bef7645705
2 changed files with 4 additions and 1 deletions
  1. +2
    -0
      app/src/main/java/eu/faircode/email/MessageHelper.java
  2. +2
    -1
      app/src/main/java/eu/faircode/email/ServiceSynchronize.java

+ 2
- 0
app/src/main/java/eu/faircode/email/MessageHelper.java View File

@ -70,6 +70,8 @@ public class MessageHelper {
props.put("mail.imaps.timeout", "20000");
props.put("mail.imaps.writetimeout", "20000"); // one thread overhead
props.put("mail.imaps.connectionpooltimeout", Integer.toString(3 * 60 * 1000)); // default: 45 sec
// https://javaee.github.io/javamail/docs/api/com/sun/mail/smtp/package-summary.html#properties
props.put("mail.smtps.ssl.checkserveridentity", "true");
props.put("mail.smtps.ssl.trust", "*");


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

@ -469,6 +469,7 @@ public class ServiceSynchronize extends LifecycleService {
db.folder().setFolderState(folder.id, null);
db.account().setAccountState(account.id, "connecting");
istore.connect(account.host, account.port, account.user, account.password);
boolean hasIdle = istore.hasCapability("IDLE");
backoff = CONNECT_BACKOFF_START;
db.account().setAccountState(account.id, "connected");
@ -627,7 +628,7 @@ public class ServiceSynchronize extends LifecycleService {
noops.add(noop);
// Receive folder events
if (istore.hasCapability("IDLE")) {
if (hasIdle) {
Thread idle = new Thread(new Runnable() {
@Override
public void run() {


Loading…
Cancel
Save