diff --git a/app/src/main/java/eu/faircode/email/EmailService.java b/app/src/main/java/eu/faircode/email/EmailService.java index 6ca84f3356..6ce585293c 100644 --- a/app/src/main/java/eu/faircode/email/EmailService.java +++ b/app/src/main/java/eu/faircode/email/EmailService.java @@ -192,11 +192,13 @@ public class EmailService implements AutoCloseable { boolean auth_login = prefs.getBoolean("auth_login", true); boolean auth_ntlm = prefs.getBoolean("auth_ntlm", true); boolean auth_sasl = prefs.getBoolean("auth_sasl", true); + boolean auth_apop = prefs.getBoolean("auth_apop", false); Log.i("Authenticate" + " plain=" + auth_plain + " login=" + auth_login + " ntlm=" + auth_ntlm + - " sasl=" + auth_sasl); + " sasl=" + auth_sasl + + " apop=" + auth_apop); properties.put("mail.event.scope", "folder"); properties.put("mail.event.executor", executor); @@ -207,6 +209,8 @@ public class EmailService implements AutoCloseable { properties.put("mail." + protocol + ".auth.login.disable", "true"); if (!auth_ntlm) properties.put("mail." + protocol + ".auth.ntlm.disable", "true"); + if (auth_apop) + properties.put("mail." + protocol + ".apop.enable", "true"); // SASL is attempted before other authentication methods properties.put("mail." + protocol + ".sasl.enable", Boolean.toString(auth_sasl)); diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java index 4df9ec0610..ebe36e66ec 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java @@ -156,6 +156,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc private SwitchCompat swAuthLogin; private SwitchCompat swAuthNtlm; private SwitchCompat swAuthSasl; + private SwitchCompat swAuthApop; private SwitchCompat swKeepAlivePoll; private SwitchCompat swEmptyPool; private SwitchCompat swIdleDone; @@ -196,7 +197,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc "query_threads", "wal", "checkpoints", "sqlite_cache", "chunk_size", "undo_manager", "webview_legacy", "use_modseq", "uid_command", "perform_expunge", "uid_expunge", - "auth_plain", "auth_login", "auth_ntlm", "auth_sasl", + "auth_plain", "auth_login", "auth_ntlm", "auth_sasl", "auth_apop", "keep_alive_poll", "empty_pool", "idle_done", "exact_alarms", "infra", "dup_msgids", "test_iab" }; @@ -305,6 +306,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc swAuthLogin = view.findViewById(R.id.swAuthLogin); swAuthNtlm = view.findViewById(R.id.swAuthNtlm); swAuthSasl = view.findViewById(R.id.swAuthSasl); + swAuthApop = view.findViewById(R.id.swAuthApop); swKeepAlivePoll = view.findViewById(R.id.swKeepAlivePoll); swEmptyPool = view.findViewById(R.id.swEmptyPool); swIdleDone = view.findViewById(R.id.swIdleDone); @@ -1003,6 +1005,13 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc } }); + swAuthApop.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { + prefs.edit().putBoolean("auth_apop", checked).apply(); + } + }); + swKeepAlivePoll.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { @@ -1528,6 +1537,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc swAuthLogin.setChecked(prefs.getBoolean("auth_login", true)); swAuthNtlm.setChecked(prefs.getBoolean("auth_ntlm", true)); swAuthSasl.setChecked(prefs.getBoolean("auth_sasl", true)); + swAuthApop.setChecked(prefs.getBoolean("auth_apop", false)); swKeepAlivePoll.setChecked(prefs.getBoolean("keep_alive_poll", false)); swEmptyPool.setChecked(prefs.getBoolean("empty_pool", true)); swIdleDone.setChecked(prefs.getBoolean("idle_done", true)); diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index d361aa3b9e..b1d0886e99 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -155,7 +155,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences "download_headers", "download_eml", "prefer_ip4", "bind_socket", "standalone_vpn", "tcp_keep_alive", "ssl_harden", "cert_strict", // force reconnect "experiments", "debug", "protocol", // force reconnect - "auth_plain", "auth_login", "auth_ntlm", "auth_sasl", // force reconnect + "auth_plain", "auth_login", "auth_ntlm", "auth_sasl", "auth_apop", // force reconnect "keep_alive_poll", "empty_pool", "idle_done", // force reconnect "exact_alarms" // force schedule )); diff --git a/app/src/main/res/layout/fragment_options_misc.xml b/app/src/main/res/layout/fragment_options_misc.xml index 4d9f102f58..c9803cfd84 100644 --- a/app/src/main/res/layout/fragment_options_misc.xml +++ b/app/src/main/res/layout/fragment_options_misc.xml @@ -980,6 +980,17 @@ app:layout_constraintTop_toBottomOf="@id/swAuthNtlm" app:switchPadding="12dp" /> + + LOGIN NTLM SASL + APOP IDLE/DONE Poll on keep-alive Empty connection pool