mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-10 19:13:03 +02:00
Added idle restart for Outlook
This commit is contained in:
@@ -329,6 +329,10 @@ public class EmailService implements AutoCloseable {
|
||||
properties.put("mail." + protocol + ".allow8bitmime", Boolean.toString(value));
|
||||
}
|
||||
|
||||
void setRestartIdleInterval(int seconds) {
|
||||
properties.put("mail." + protocol + ".restartidleinterval", Integer.toString(seconds));
|
||||
}
|
||||
|
||||
// https://tools.ietf.org/html/rfc3461
|
||||
void setDsnNotify(String what) {
|
||||
properties.put("mail." + protocol + ".dsn.notify", what);
|
||||
|
||||
@@ -1518,6 +1518,11 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
||||
if (account.protocol != EntityAccount.TYPE_IMAP)
|
||||
iservice.setLeaveOnServer(account.leave_on_server);
|
||||
|
||||
if ("outlook.office365.com".equalsIgnoreCase(account.host)) {
|
||||
int timeout = prefs.getInt("timeout", EmailService.DEFAULT_CONNECT_TIMEOUT);
|
||||
iservice.setRestartIdleInterval(timeout * 2 * 6); // 20 x 2 x 6 = 4 min
|
||||
}
|
||||
|
||||
final Date lastStillHere = new Date(0);
|
||||
|
||||
iservice.setListener(new StoreListener() {
|
||||
|
||||
Reference in New Issue
Block a user