Forget TOP headers

pull/213/head
M66B 1 year ago
parent f1b8431bba
commit 1ed355c9e4

@ -195,13 +195,15 @@ public class EmailService implements AutoCloseable {
boolean auth_sasl = prefs.getBoolean("auth_sasl", true); boolean auth_sasl = prefs.getBoolean("auth_sasl", true);
boolean auth_apop = prefs.getBoolean("auth_apop", false); boolean auth_apop = prefs.getBoolean("auth_apop", false);
boolean use_top = prefs.getBoolean("use_top", true); boolean use_top = prefs.getBoolean("use_top", true);
boolean forget_top = prefs.getBoolean("forget_top", true);
Log.i("Authenticate" + Log.i("Authenticate" +
" plain=" + auth_plain + " plain=" + auth_plain +
" login=" + auth_login + " login=" + auth_login +
" ntlm=" + auth_ntlm + " ntlm=" + auth_ntlm +
" sasl=" + auth_sasl + " sasl=" + auth_sasl +
" apop=" + auth_apop + " apop=" + auth_apop +
" use_top=" + use_top); " use_top=" + use_top +
" forget_top=" + forget_top);
//properties.put("mail.event.scope", "folder"); //properties.put("mail.event.scope", "folder");
//properties.put("mail.event.executor", executor); //properties.put("mail.event.executor", executor);
@ -216,6 +218,8 @@ public class EmailService implements AutoCloseable {
properties.put("mail." + protocol + ".apop.enable", "true"); properties.put("mail." + protocol + ".apop.enable", "true");
if (!use_top) if (!use_top)
properties.put("mail." + protocol + ".disabletop", "true"); properties.put("mail." + protocol + ".disabletop", "true");
if (forget_top)
properties.put("mail." + protocol + ".forgettopheaders", "true");
// SASL is attempted before other authentication methods // SASL is attempted before other authentication methods
properties.put("mail." + protocol + ".sasl.enable", Boolean.toString(auth_sasl)); properties.put("mail." + protocol + ".sasl.enable", Boolean.toString(auth_sasl));

@ -224,6 +224,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private SwitchCompat swAuthSasl; private SwitchCompat swAuthSasl;
private SwitchCompat swAuthApop; private SwitchCompat swAuthApop;
private SwitchCompat swUseTop; private SwitchCompat swUseTop;
private SwitchCompat swForgetTop;
private SwitchCompat swKeepAlivePoll; private SwitchCompat swKeepAlivePoll;
private SwitchCompat swEmptyPool; private SwitchCompat swEmptyPool;
private SwitchCompat swIdleDone; private SwitchCompat swIdleDone;
@ -299,7 +300,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
"browser_zoom", "fake_dark", "browser_zoom", "fake_dark",
"show_recent", "show_recent",
"use_modseq", "preamble", "uid_command", "perform_expunge", "uid_expunge", "use_modseq", "preamble", "uid_command", "perform_expunge", "uid_expunge",
"auth_plain", "auth_login", "auth_ntlm", "auth_sasl", "auth_apop", "use_top", "auth_plain", "auth_login", "auth_ntlm", "auth_sasl", "auth_apop", "use_top", "forget_top",
"keep_alive_poll", "empty_pool", "idle_done", "fast_fetch", "keep_alive_poll", "empty_pool", "idle_done", "fast_fetch",
"max_backoff_power", "logarithmic_backoff", "max_backoff_power", "logarithmic_backoff",
"exact_alarms", "exact_alarms",
@ -477,6 +478,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
swAuthSasl = view.findViewById(R.id.swAuthSasl); swAuthSasl = view.findViewById(R.id.swAuthSasl);
swAuthApop = view.findViewById(R.id.swAuthApop); swAuthApop = view.findViewById(R.id.swAuthApop);
swUseTop = view.findViewById(R.id.swUseTop); swUseTop = view.findViewById(R.id.swUseTop);
swForgetTop = view.findViewById(R.id.swForgetTop);
swKeepAlivePoll = view.findViewById(R.id.swKeepAlivePoll); swKeepAlivePoll = view.findViewById(R.id.swKeepAlivePoll);
swEmptyPool = view.findViewById(R.id.swEmptyPool); swEmptyPool = view.findViewById(R.id.swEmptyPool);
swIdleDone = view.findViewById(R.id.swIdleDone); swIdleDone = view.findViewById(R.id.swIdleDone);
@ -1738,6 +1740,13 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
} }
}); });
swForgetTop.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("forget_top", checked).apply();
}
});
swKeepAlivePoll.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { swKeepAlivePoll.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override @Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@ -2607,6 +2616,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
swAuthSasl.setChecked(prefs.getBoolean("auth_sasl", true)); swAuthSasl.setChecked(prefs.getBoolean("auth_sasl", true));
swAuthApop.setChecked(prefs.getBoolean("auth_apop", false)); swAuthApop.setChecked(prefs.getBoolean("auth_apop", false));
swUseTop.setChecked(prefs.getBoolean("use_top", true)); swUseTop.setChecked(prefs.getBoolean("use_top", true));
swForgetTop.setChecked(prefs.getBoolean("forget_top", true));
swKeepAlivePoll.setChecked(prefs.getBoolean("keep_alive_poll", false)); swKeepAlivePoll.setChecked(prefs.getBoolean("keep_alive_poll", false));
swEmptyPool.setChecked(prefs.getBoolean("empty_pool", true)); swEmptyPool.setChecked(prefs.getBoolean("empty_pool", true));
swIdleDone.setChecked(prefs.getBoolean("idle_done", true)); swIdleDone.setChecked(prefs.getBoolean("idle_done", true));

@ -1850,6 +1850,18 @@
app:layout_constraintTop_toBottomOf="@id/swAuthApop" app:layout_constraintTop_toBottomOf="@id/swAuthApop"
app:switchPadding="12dp" /> app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swForgetTop"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_advanced_forget_top"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swUseTop"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat <androidx.appcompat.widget.SwitchCompat
android:id="@+id/swKeepAlivePoll" android:id="@+id/swKeepAlivePoll"
android:layout_width="0dp" android:layout_width="0dp"
@ -1858,7 +1870,7 @@
android:text="@string/title_advanced_keep_alive_poll" android:text="@string/title_advanced_keep_alive_poll"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swUseTop" app:layout_constraintTop_toBottomOf="@id/swForgetTop"
app:switchPadding="12dp" /> app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat <androidx.appcompat.widget.SwitchCompat

@ -887,6 +887,7 @@
<string name="title_advanced_auth_sasl" translatable="false">SASL</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_auth_apop" translatable="false">APOP</string>
<string name="title_advanced_use_top" translatable="false">Use TOP</string> <string name="title_advanced_use_top" translatable="false">Use TOP</string>
<string name="title_advanced_forget_top" translatable="false">Forget TOP headers</string>
<string name="title_advanced_idle_done" translatable="false">IDLE/DONE</string> <string name="title_advanced_idle_done" translatable="false">IDLE/DONE</string>
<string name="title_advanced_fast_fetch" translatable="false">Fast FETCH</string> <string name="title_advanced_fast_fetch" translatable="false">Fast FETCH</string>
<string name="title_advanced_max_backoff" translatable="false">Max. back-off: %1$d s</string> <string name="title_advanced_max_backoff" translatable="false">Max. back-off: %1$d s</string>

Loading…
Cancel
Save