mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-07 01:23:38 +02:00
Added setting to turn off NTLM
This commit is contained in:
@@ -179,8 +179,13 @@ public class EmailService implements AutoCloseable {
|
||||
|
||||
boolean auth_plain = prefs.getBoolean("auth_plain", true);
|
||||
boolean auth_login = prefs.getBoolean("auth_login", true);
|
||||
boolean auth_ntlm = prefs.getBoolean("auth_ntlm", true);
|
||||
boolean auth_sasl = prefs.getBoolean("auth_sasl", true);
|
||||
Log.i("Authenticate plain=" + auth_plain + " login=" + auth_login + " sasl=" + auth_sasl);
|
||||
Log.i("Authenticate" +
|
||||
" plain=" + auth_plain +
|
||||
" login=" + auth_login +
|
||||
" ntlm=" + auth_ntlm +
|
||||
" sasl=" + auth_sasl);
|
||||
|
||||
properties.put("mail.event.scope", "folder");
|
||||
properties.put("mail.event.executor", executor);
|
||||
@@ -189,6 +194,8 @@ public class EmailService implements AutoCloseable {
|
||||
properties.put("mail." + protocol + ".auth.plain.disable", "true");
|
||||
if (!auth_login)
|
||||
properties.put("mail." + protocol + ".auth.login.disable", "true");
|
||||
if (!auth_ntlm)
|
||||
properties.put("mail." + protocol + ".auth.ntlm.disable", "true");
|
||||
|
||||
// SASL is attempted before other authentication methods
|
||||
properties.put("mail." + protocol + ".sasl.enable", Boolean.toString(auth_sasl));
|
||||
|
||||
@@ -111,6 +111,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
private SwitchCompat swDebug;
|
||||
private SwitchCompat swAuthPlain;
|
||||
private SwitchCompat swAuthLogin;
|
||||
private SwitchCompat swAuthNtlm;
|
||||
private SwitchCompat swAuthSasl;
|
||||
private TextView tvProcessors;
|
||||
private TextView tvMemoryClass;
|
||||
@@ -132,7 +133,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
"classification", "class_min_probability", "class_min_difference",
|
||||
"language", "watchdog", "updates",
|
||||
"experiments", "query_threads", "crash_reports", "cleanup_attachments",
|
||||
"protocol", "debug", "auth_plain", "auth_login", "auth_sasl"
|
||||
"protocol", "debug", "auth_plain", "auth_login", "auth_ntlm", "auth_sasl"
|
||||
};
|
||||
|
||||
private final static String[] RESET_QUESTIONS = new String[]{
|
||||
@@ -201,6 +202,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
swDebug = view.findViewById(R.id.swDebug);
|
||||
swAuthPlain = view.findViewById(R.id.swAuthPlain);
|
||||
swAuthLogin = view.findViewById(R.id.swAuthLogin);
|
||||
swAuthNtlm = view.findViewById(R.id.swAuthNtlm);
|
||||
swAuthSasl = view.findViewById(R.id.swAuthSasl);
|
||||
tvProcessors = view.findViewById(R.id.tvProcessors);
|
||||
tvMemoryClass = view.findViewById(R.id.tvMemoryClass);
|
||||
@@ -481,6 +483,13 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
}
|
||||
});
|
||||
|
||||
swAuthNtlm.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
prefs.edit().putBoolean("auth_ntlm", checked).apply();
|
||||
}
|
||||
});
|
||||
|
||||
swAuthSasl.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
@@ -840,6 +849,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
swDebug.setChecked(prefs.getBoolean("debug", false));
|
||||
swAuthPlain.setChecked(prefs.getBoolean("auth_plain", true));
|
||||
swAuthLogin.setChecked(prefs.getBoolean("auth_login", true));
|
||||
swAuthNtlm.setChecked(prefs.getBoolean("auth_ntlm", true));
|
||||
swAuthSasl.setChecked(prefs.getBoolean("auth_sasl", true));
|
||||
|
||||
tvProcessors.setText(getString(R.string.title_advanced_processors, Runtime.getRuntime().availableProcessors()));
|
||||
|
||||
@@ -148,9 +148,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
||||
"prefer_ip4", "standalone_vpn", "tcp_keep_alive", "ssl_harden", // force reconnect
|
||||
"badge", "unseen_ignored", // force update badge/widget
|
||||
"experiments", "debug", "protocol", // force reconnect
|
||||
"auth_plain",
|
||||
"auth_login",
|
||||
"auth_sasl"
|
||||
"auth_plain", "auth_login", "auth_ntlm", "auth_sasl" // force reconnect
|
||||
));
|
||||
|
||||
static final int PI_ALARM = 1;
|
||||
|
||||
Reference in New Issue
Block a user