diff --git a/app/src/main/java/eu/faircode/email/EmailService.java b/app/src/main/java/eu/faircode/email/EmailService.java
index 8d6ae0e76b..d14721676f 100644
--- a/app/src/main/java/eu/faircode/email/EmailService.java
+++ b/app/src/main/java/eu/faircode/email/EmailService.java
@@ -144,7 +144,8 @@ public class EmailService implements AutoCloseable {
boolean socks_enabled = prefs.getBoolean("socks_enabled", false);
String socks_proxy = prefs.getString("socks_proxy", "localhost:9050");
- boolean sasl = prefs.getBoolean("sasl", true);
+ boolean auth_plain = prefs.getBoolean("auth_plain", true);
+ boolean auth_sasl = prefs.getBoolean("auth_sasl", true);
// SOCKS proxy
if (socks_enabled) {
@@ -163,11 +164,10 @@ public class EmailService implements AutoCloseable {
properties.put("mail.event.scope", "folder");
properties.put("mail.event.executor", executor);
- //properties.put("mail." + protocol + ".auth.login.disable", "true");
- //properties.put("mail." + protocol + ".auth.plain.disable", "true");
+ properties.put("mail." + protocol + ".auth.plain.disable", Boolean.toString(!auth_plain));
properties.put("mail." + protocol + ".sasl.enable", "true");
- if (sasl) {
+ if (auth_sasl) {
properties.put("mail." + protocol + ".sasl.mechanisms", "CRAM-MD5");
properties.put("mail." + protocol + ".sasl.realm", realm == null ? "" : realm);
}
diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java
index 6ad12acdb0..dcc34f97a5 100644
--- a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java
+++ b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java
@@ -77,7 +77,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private SwitchCompat swCrashReports;
private TextView tvUuid;
private SwitchCompat swDebug;
- private SwitchCompat swSasl;
+ private SwitchCompat swAuthPlain;
+ private SwitchCompat swAuthSasl;
private Button btnReset;
private SwitchCompat swCleanupAttachments;
private Button btnCleanup;
@@ -95,7 +96,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private final static String[] RESET_OPTIONS = new String[]{
"shortcuts", "fts", "english", "watchdog", "auto_optimize", "updates",
- "experiments", "crash_reports", "debug", "sasl", "cleanup_attachments"
+ "experiments", "crash_reports", "debug", "auth_plain", "auth_sasl", "cleanup_attachments"
};
private final static String[] RESET_QUESTIONS = new String[]{
@@ -132,7 +133,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
swCrashReports = view.findViewById(R.id.swCrashReports);
tvUuid = view.findViewById(R.id.tvUuid);
swDebug = view.findViewById(R.id.swDebug);
- swSasl = view.findViewById(R.id.swSasl);
+ swAuthPlain = view.findViewById(R.id.swAuthPlain);
+ swAuthSasl = view.findViewById(R.id.swAuthSasl);
btnReset = view.findViewById(R.id.btnReset);
swCleanupAttachments = view.findViewById(R.id.swCleanupAttachments);
btnCleanup = view.findViewById(R.id.btnCleanup);
@@ -279,11 +281,19 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
}
});
- swSasl.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+ swAuthPlain.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
- prefs.edit().putBoolean("sasl", checked).apply();
- ServiceSynchronize.reload(getContext(), -1L, false, "sasl=" + checked);
+ prefs.edit().putBoolean("auth_plain", checked).apply();
+ ServiceSynchronize.reload(getContext(), -1L, false, "auth_plain=" + checked);
+ }
+ });
+
+ swAuthSasl.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+ @Override
+ public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
+ prefs.edit().putBoolean("auth_sasl", checked).apply();
+ ServiceSynchronize.reload(getContext(), -1L, false, "auth_sasl=" + checked);
}
});
@@ -527,7 +537,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
swCrashReports.setChecked(prefs.getBoolean("crash_reports", false));
tvUuid.setText(prefs.getString("uuid", null));
swDebug.setChecked(prefs.getBoolean("debug", false));
- swSasl.setChecked(prefs.getBoolean("sasl", true));
+ swAuthPlain.setChecked(prefs.getBoolean("auth_plain", true));
+ swAuthSasl.setChecked(prefs.getBoolean("auth_sasl", true));
swCleanupAttachments.setChecked(prefs.getBoolean("cleanup_attachments", false));
tvProcessors.setText(getString(R.string.title_advanced_processors, Runtime.getRuntime().availableProcessors()));
diff --git a/app/src/main/res/layout/fragment_options_misc.xml b/app/src/main/res/layout/fragment_options_misc.xml
index 22db0c5278..07570ef28b 100644
--- a/app/src/main/res/layout/fragment_options_misc.xml
+++ b/app/src/main/res/layout/fragment_options_misc.xml
@@ -255,17 +255,29 @@
app:layout_constraintTop_toBottomOf="@id/swDebug" />
+
+
+ app:layout_constraintTop_toBottomOf="@id/swAuthSasl" />
+ app:constraint_referenced_ids="swAuthPlain,swAuthSasl,tvProcessors,tvMemoryClass,tvStorageSpace,tvFingerprint,btnCharsets,btnCiphers" />
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 265e01530c..3bba86af7d 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -449,7 +449,8 @@
%1$d / %2$d messages indexed (%3$s)
Use US country settings
Periodically check if FairEmail is still active
- CRAM-MD5
+ PLAIN
+ SASL
Automatically optimize settings
Check for updates
Try experimental features