Browse Source

Set SMTP write timeout

main
M66B 6 years ago
parent
commit
3f0fb8389d
1 changed files with 8 additions and 2 deletions
  1. +8
    -2
      app/src/main/java/eu/faircode/email/MessageHelper.java

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

@ -64,25 +64,31 @@ public class MessageHelper {
props.put("mail.imaps.ssl.trust", "*"); props.put("mail.imaps.ssl.trust", "*");
props.put("mail.imaps.starttls.enable", "false"); props.put("mail.imaps.starttls.enable", "false");
// TODO: make timeouts configurable?
props.put("mail.imaps.connectiontimeout", "20000"); props.put("mail.imaps.connectiontimeout", "20000");
props.put("mail.imaps.timeout", "20000"); props.put("mail.imaps.timeout", "20000");
props.put("mail.imaps.writetimeout", "20000"); // one thread overhead props.put("mail.imaps.writetimeout", "20000"); // one thread overhead
// 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.checkserveridentity", "true");
props.put("mail.smtps.ssl.trust", "*"); props.put("mail.smtps.ssl.trust", "*");
props.put("mail.smtps.starttls.enable", "false"); props.put("mail.smtps.starttls.enable", "false");
props.put("mail.smtps.starttls.required", "false"); props.put("mail.smtps.starttls.required", "false");
props.put("mail.smtps.auth", "true"); props.put("mail.smtps.auth", "true");
props.put("mail.smtps.timeout", "20000");
props.put("mail.smtps.connectiontimeout", "20000"); props.put("mail.smtps.connectiontimeout", "20000");
props.put("mail.smtps.writetimeout", "20000"); // one thread overhead
props.put("mail.smtps.timeout", "20000");
props.put("mail.smtp.ssl.checkserveridentity", "true"); props.put("mail.smtp.ssl.checkserveridentity", "true");
props.put("mail.smtp.ssl.trust", "*"); props.put("mail.smtp.ssl.trust", "*");
props.put("mail.smtp.starttls.enable", "true"); props.put("mail.smtp.starttls.enable", "true");
props.put("mail.smtp.starttls.required", "true"); props.put("mail.smtp.starttls.required", "true");
props.put("mail.smtp.auth", "true"); props.put("mail.smtp.auth", "true");
props.put("mail.smtp.timeout", "20000");
props.put("mail.smtp.connectiontimeout", "20000"); props.put("mail.smtp.connectiontimeout", "20000");
props.put("mail.smtp.writetimeout", "20000"); // one thread overhead
props.put("mail.smtp.timeout", "20000");
return props; return props;
} }


Loading…
Cancel
Save