Added max. TLS to provider profiles

pull/210/head
M66B 2 years ago
parent b901fde5f2
commit df92814dcb

@ -88,6 +88,7 @@ public class EmailProvider implements Parcelable {
public boolean partial; public boolean partial;
public boolean useip; public boolean useip;
public boolean appPassword; public boolean appPassword;
public String maxtls;
public String link; public String link;
public Server imap = new Server(); public Server imap = new Server();
public Server smtp = new Server(); public Server smtp = new Server();
@ -241,6 +242,7 @@ public class EmailProvider implements Parcelable {
provider.partial = getAttributeBooleanValue(xml, "partial", true); provider.partial = getAttributeBooleanValue(xml, "partial", true);
provider.useip = getAttributeBooleanValue(xml, "useip", true); provider.useip = getAttributeBooleanValue(xml, "useip", true);
provider.appPassword = getAttributeBooleanValue(xml, "appPassword", false); provider.appPassword = getAttributeBooleanValue(xml, "appPassword", false);
provider.maxtls = xml.getAttributeValue(null, "maxtls");
provider.link = xml.getAttributeValue(null, "link"); provider.link = xml.getAttributeValue(null, "link");
String documentation = xml.getAttributeValue(null, "documentation"); String documentation = xml.getAttributeValue(null, "documentation");

@ -47,6 +47,7 @@ import com.sun.mail.util.SocketConnectException;
import com.sun.mail.util.TraceOutputStream; import com.sun.mail.util.TraceOutputStream;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import java.io.PrintStream; import java.io.PrintStream;
@ -430,7 +431,18 @@ public class EmailService implements AutoCloseable {
} }
} }
factory = new SSLSocketFactoryService(host, insecure, ssl_harden, ssl_harden_strict, cert_strict, key, chain, fingerprint); boolean strict = ssl_harden_strict;
if (provider != null)
try {
EmailProvider p = EmailProvider.getProvider(context, provider);
if ("1.2".equals(p.maxtls)) {
strict = false;
Log.i(p.name + " maxtls=" + p.maxtls);
}
} catch (FileNotFoundException ignored) {
}
factory = new SSLSocketFactoryService(host, insecure, ssl_harden, strict, cert_strict, key, chain, fingerprint);
properties.put("mail." + protocol + ".ssl.socketFactory", factory); properties.put("mail." + protocol + ".ssl.socketFactory", factory);
properties.put("mail." + protocol + ".socketFactory.fallback", "false"); properties.put("mail." + protocol + ".socketFactory.fallback", "false");
properties.put("mail." + protocol + ".ssl.checkserveridentity", "false"); properties.put("mail." + protocol + ".ssl.checkserveridentity", "false");

@ -44,6 +44,7 @@
name="Outlook" name="Outlook"
domain="outlook\\..*" domain="outlook\\..*"
link="https://github.com/M66B/FairEmail/blob/master/FAQ.md#user-content-faq14" link="https://github.com/M66B/FairEmail/blob/master/FAQ.md#user-content-faq14"
maxtls="1.2"
noop="true" noop="true"
order="2" order="2"
partial="false" partial="false"
@ -61,6 +62,7 @@
name="Live" name="Live"
domain="live\\..*" domain="live\\..*"
link="https://github.com/M66B/FairEmail/blob/master/FAQ.md#user-content-faq14" link="https://github.com/M66B/FairEmail/blob/master/FAQ.md#user-content-faq14"
maxtls="1.2"
noop="true" noop="true"
order="3" order="3"
partial="false" partial="false"
@ -78,6 +80,7 @@
name="Hotmail" name="Hotmail"
domain="hotmail\\..*" domain="hotmail\\..*"
link="https://github.com/M66B/FairEmail/blob/master/FAQ.md#user-content-faq14" link="https://github.com/M66B/FairEmail/blob/master/FAQ.md#user-content-faq14"
maxtls="1.2"
noop="true" noop="true"
order="4" order="4"
partial="false" partial="false"
@ -94,6 +97,7 @@
<provider <provider
name="MSN" name="MSN"
domain="\\.msn\\..*" domain="\\.msn\\..*"
maxtls="1.2"
partial="false"> partial="false">
<imap <imap
host="imap-mail.outlook.com" host="imap-mail.outlook.com"
@ -110,6 +114,7 @@
enabled="false" enabled="false"
id="office365" id="office365"
link="https://github.com/M66B/FairEmail/blob/master/FAQ.md#user-content-faq14" link="https://github.com/M66B/FairEmail/blob/master/FAQ.md#user-content-faq14"
maxtls="1.2"
noop="true" noop="true"
order="5" order="5"
partial="false" partial="false"
@ -148,6 +153,7 @@
description="Outlook/Office 365" description="Outlook/Office 365"
id="office365pcke" id="office365pcke"
link="https://github.com/M66B/FairEmail/blob/master/FAQ.md#user-content-faq14" link="https://github.com/M66B/FairEmail/blob/master/FAQ.md#user-content-faq14"
maxtls="1.2"
noop="true" noop="true"
order="5" order="5"
partial="false" partial="false"
@ -186,6 +192,7 @@
enabled="false" enabled="false"
id="outlook" id="outlook"
link="https://github.com/M66B/FairEmail/blob/master/FAQ.md#user-content-faq14" link="https://github.com/M66B/FairEmail/blob/master/FAQ.md#user-content-faq14"
maxtls="1.2"
noop="true" noop="true"
order="5" order="5"
partial="false" partial="false"
@ -793,7 +800,8 @@
<provider <provider
name="Runbox" name="Runbox"
domain="runbox\\..*" domain="runbox\\..*"
link="https://help.runbox.com/email-program-settings/"> link="https://help.runbox.com/email-program-settings/"
maxtls="1.2">
<imap <imap
host="mail.runbox.com" host="mail.runbox.com"
port="993" port="993"

Loading…
Cancel
Save