From 5d8235866320aae01f13bcbb72eace77e7a74986 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 25 Jun 2024 08:13:54 +0200 Subject: [PATCH] From profile is secure --- app/src/main/java/eu/faircode/email/EmailProvider.java | 4 ++++ app/src/main/java/eu/faircode/email/FragmentQuickSetup.java | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/EmailProvider.java b/app/src/main/java/eu/faircode/email/EmailProvider.java index 6effd8adc0..19eb03973c 100644 --- a/app/src/main/java/eu/faircode/email/EmailProvider.java +++ b/app/src/main/java/eu/faircode/email/EmailProvider.java @@ -1488,6 +1488,10 @@ public class EmailProvider implements Parcelable { }); } + public boolean isSecure() { + return (score >= 100); + } + @Override public boolean equals(Object obj) { if (obj instanceof Server) { diff --git a/app/src/main/java/eu/faircode/email/FragmentQuickSetup.java b/app/src/main/java/eu/faircode/email/FragmentQuickSetup.java index 37f4f432b1..ffe52212bb 100644 --- a/app/src/main/java/eu/faircode/email/FragmentQuickSetup.java +++ b/app/src/main/java/eu/faircode/email/FragmentQuickSetup.java @@ -588,7 +588,7 @@ public class FragmentQuickSetup extends FragmentBase { account.host = provider.imap.host; account.encryption = aencryption; - account.insecure = BuildConfig.PLAY_STORE_RELEASE; + account.insecure = (BuildConfig.PLAY_STORE_RELEASE && !provider.imap.isSecure()); account.port = provider.imap.port; account.auth_type = AUTH_TYPE_PASSWORD; account.user = user; @@ -638,6 +638,7 @@ public class FragmentQuickSetup extends FragmentBase { identity.host = provider.smtp.host; identity.encryption = iencryption; + identity.insecure = (BuildConfig.PLAY_STORE_RELEASE && !provider.smtp.isSecure()); identity.port = provider.smtp.port; identity.auth_type = AUTH_TYPE_PASSWORD; identity.user = user;