mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-09 10:33:41 +02:00
Added debug option to disable IMAP compress
This commit is contained in:
@@ -219,6 +219,7 @@ public class EmailService implements AutoCloseable {
|
||||
this.cert_transparency = prefs.getBoolean("cert_transparency", false);
|
||||
this.check_names = prefs.getBoolean("check_names", !BuildConfig.PLAY_STORE_RELEASE);
|
||||
|
||||
boolean imap_compress = prefs.getBoolean("imap_compress", true);
|
||||
boolean auth_plain = prefs.getBoolean("auth_plain", true);
|
||||
boolean auth_login = prefs.getBoolean("auth_login", true);
|
||||
boolean auth_ntlm = prefs.getBoolean("auth_ntlm", true);
|
||||
@@ -311,7 +312,7 @@ public class EmailService implements AutoCloseable {
|
||||
|
||||
// https://tools.ietf.org/html/rfc4978
|
||||
// https://docs.oracle.com/javase/8/docs/api/java/util/zip/Deflater.html
|
||||
properties.put("mail." + protocol + ".compress.enable", "true");
|
||||
properties.put("mail." + protocol + ".compress.enable", Boolean.toString(imap_compress));
|
||||
//properties.put("mail.imaps.compress.level", "-1");
|
||||
//properties.put("mail.imaps.compress.strategy", "0");
|
||||
|
||||
|
||||
@@ -207,6 +207,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
private SwitchCompat swUid;
|
||||
private SwitchCompat swExpunge;
|
||||
private SwitchCompat swUidExpunge;
|
||||
private SwitchCompat swImapCompress;
|
||||
private SwitchCompat swAuthPlain;
|
||||
private SwitchCompat swAuthLogin;
|
||||
private SwitchCompat swAuthNtlm;
|
||||
@@ -307,7 +308,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
"ignore_formatted_size",
|
||||
"show_recent",
|
||||
"use_modseq", "preamble", "uid_command", "perform_expunge", "uid_expunge",
|
||||
"auth_plain", "auth_login", "auth_ntlm", "auth_sasl", "auth_apop", "use_top", "forget_top",
|
||||
"imap_compress", "auth_plain", "auth_login", "auth_ntlm", "auth_sasl", "auth_apop", "use_top", "forget_top",
|
||||
"keep_alive_poll", "empty_pool", "idle_done", "fast_fetch",
|
||||
"max_backoff_power", "logarithmic_backoff",
|
||||
"exact_alarms",
|
||||
@@ -479,6 +480,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
swUid = view.findViewById(R.id.swUid);
|
||||
swExpunge = view.findViewById(R.id.swExpunge);
|
||||
swUidExpunge = view.findViewById(R.id.swUidExpunge);
|
||||
swImapCompress = view.findViewById(R.id.swImapCompress);
|
||||
swAuthPlain = view.findViewById(R.id.swAuthPlain);
|
||||
swAuthLogin = view.findViewById(R.id.swAuthLogin);
|
||||
swAuthNtlm = view.findViewById(R.id.swAuthNtlm);
|
||||
@@ -1532,6 +1534,13 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
}
|
||||
});
|
||||
|
||||
swImapCompress.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
prefs.edit().putBoolean("imap_compress", checked).apply();
|
||||
}
|
||||
});
|
||||
|
||||
swAuthPlain.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
@@ -2613,6 +2622,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
swUid.setChecked(prefs.getBoolean("uid_command", false));
|
||||
swExpunge.setChecked(prefs.getBoolean("perform_expunge", true));
|
||||
swUidExpunge.setChecked(prefs.getBoolean("uid_expunge", false));
|
||||
swImapCompress.setChecked(prefs.getBoolean("imap_compress", true));
|
||||
swAuthPlain.setChecked(prefs.getBoolean("auth_plain", true));
|
||||
swAuthLogin.setChecked(prefs.getBoolean("auth_login", true));
|
||||
swAuthNtlm.setChecked(prefs.getBoolean("auth_ntlm", true));
|
||||
|
||||
@@ -182,7 +182,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
||||
"ssl_harden", "ssl_harden_strict", "cert_strict", "cert_transparency", "check_names", "bouncy_castle", "bc_fips", // force reconnect
|
||||
"experiments", "debug", "protocol", // force reconnect
|
||||
//"restart_interval", // force reconnect
|
||||
"auth_plain", "auth_login", "auth_ntlm", "auth_sasl", "auth_apop", // force reconnect
|
||||
"imap_compress", "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
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user