Added debug option to disable IMAP compress

master
M66B 4 weeks ago
parent 2de429b243
commit 353b3cb621

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

@ -1480,6 +1480,18 @@
app:layout_constraintTop_toBottomOf="@id/swExpunge"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swImapCompress"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_imap_compress"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swUidExpunge"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swAuthPlain"
android:layout_width="0dp"
@ -1489,7 +1501,7 @@
android:text="@string/title_advanced_auth_plain"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swUidExpunge"
app:layout_constraintTop_toBottomOf="@id/swImapCompress"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat

@ -998,6 +998,7 @@
<string name="title_advanced_expunge" translatable="false">AUTO EXPUNGE</string>
<string name="title_advanced_uid_expunge" translatable="false">UID EXPUNGE</string>
<string name="title_advanced_hide_deleted" translatable="false">Hide deleted messages</string>
<string name="title_advanced_imap_compress" translatable="false">COMPRESS</string>
<string name="title_advanced_auth_plain" translatable="false">PLAIN</string>
<string name="title_advanced_auth_login" translatable="false">LOGIN</string>
<string name="title_advanced_auth_ntlm" translatable="false">NTLM</string>

Loading…
Cancel
Save