diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java index 11ccd21017..1a84e5b7be 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java @@ -227,6 +227,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc private SwitchCompat swLogarithmicBackoff; private SwitchCompat swExactAlarms; private SwitchCompat swNativeDkim; + private SwitchCompat swNativeArc; private SwitchCompat swInfra; private SwitchCompat swDupMsgId; private EditText etKeywords; @@ -287,7 +288,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc "auth_plain", "auth_login", "auth_ntlm", "auth_sasl", "auth_apop", "use_top", "keep_alive_poll", "empty_pool", "idle_done", "fast_fetch", "max_backoff_power", "logarithmic_backoff", - "exact_alarms", "native_dkim", "infra", "dkim_verify", "dup_msgids", "global_keywords", "test_iab" + "exact_alarms", "native_dkim", "native_arc", "infra", "dkim_verify", "dup_msgids", "global_keywords", "test_iab" }; private final static String[] RESET_QUESTIONS = new String[]{ @@ -462,6 +463,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc swLogarithmicBackoff = view.findViewById(R.id.swLogarithmicBackoff); swExactAlarms = view.findViewById(R.id.swExactAlarms); swNativeDkim = view.findViewById(R.id.swNativeDkim); + swNativeArc = view.findViewById(R.id.swNativeArc); swInfra = view.findViewById(R.id.swInfra); swDupMsgId = view.findViewById(R.id.swDupMsgId); etKeywords = view.findViewById(R.id.etKeywords); @@ -1701,6 +1703,15 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc @Override public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { prefs.edit().putBoolean("native_dkim", checked).apply(); + swNativeArc.setEnabled(checked && swNativeDkim.isEnabled()); + } + }); + + swNativeArc.setEnabled(!BuildConfig.PLAY_STORE_RELEASE); + swNativeArc.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { + prefs.edit().putBoolean("native_arc", checked).apply(); } }); @@ -2425,6 +2436,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc swLogarithmicBackoff.setChecked(prefs.getBoolean("logarithmic_backoff", true)); swExactAlarms.setChecked(prefs.getBoolean("exact_alarms", true)); swNativeDkim.setChecked(prefs.getBoolean("native_dkim", false)); + swNativeArc.setChecked(prefs.getBoolean("native_arc", true)); swInfra.setChecked(prefs.getBoolean("infra", false)); swDupMsgId.setChecked(prefs.getBoolean("dup_msgids", false)); etKeywords.setText(prefs.getString("global_keywords", null)); diff --git a/app/src/main/java/eu/faircode/email/MessageHelper.java b/app/src/main/java/eu/faircode/email/MessageHelper.java index cbd537d441..02cb320c25 100644 --- a/app/src/main/java/eu/faircode/email/MessageHelper.java +++ b/app/src/main/java/eu/faircode/email/MessageHelper.java @@ -2028,7 +2028,9 @@ public class MessageHelper { Log.i("DKIM signers=" + TextUtils.join(",", signers)); - if (signers.size() == 0) { + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); + boolean native_arc = prefs.getBoolean("native_arc", true); + if (signers.size() == 0 && native_arc) { // https://datatracker.ietf.org/doc/html/rfc8617#section-5.2 boolean ok = true; // Until it is not Map as = new HashMap<>(); @@ -2065,6 +2067,8 @@ public class MessageHelper { if (!ok) break; } + + ok = (ok && as.size() > 0); Log.i("ARC as=" + as.size() + " aar=" + aar.size() + " ams=" + ams.size() + " ok=" + ok); if (ok && diff --git a/app/src/main/res/layout/fragment_options_misc.xml b/app/src/main/res/layout/fragment_options_misc.xml index 90c6907268..5e95e1fb35 100644 --- a/app/src/main/res/layout/fragment_options_misc.xml +++ b/app/src/main/res/layout/fragment_options_misc.xml @@ -1863,6 +1863,18 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/swNativeDkim" /> + +