Added debug APOP option

pull/194/merge
M66B 3 years ago
parent f2a92071c3
commit f78925fb23

@ -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));

@ -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));

@ -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
));

@ -980,6 +980,17 @@
app:layout_constraintTop_toBottomOf="@id/swAuthNtlm"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swAuthApop"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_auth_apop"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swAuthSasl"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swKeepAlivePoll"
android:layout_width="0dp"
@ -988,7 +999,7 @@
android:text="@string/title_advanced_keep_alive_poll"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swAuthSasl"
app:layout_constraintTop_toBottomOf="@id/swAuthApop"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat

@ -704,6 +704,7 @@
<string name="title_advanced_auth_login" translatable="false">LOGIN</string>
<string name="title_advanced_auth_ntlm" translatable="false">NTLM</string>
<string name="title_advanced_auth_sasl" translatable="false">SASL</string>
<string name="title_advanced_auth_apop" translatable="false">APOP</string>
<string name="title_advanced_idle_done" translatable="false">IDLE/DONE</string>
<string name="title_advanced_keep_alive_poll" translatable="false">Poll on keep-alive</string>
<string name="title_advanced_empty_pool" translatable="false">Empty connection pool</string>

Loading…
Cancel
Save