mirror of https://github.com/M66B/FairEmail.git
Added support for RFC 8314
This commit is contained in:
parent
0666eb9011
commit
6a98b75603
|
@ -524,7 +524,7 @@ public class EmailProvider {
|
||||||
provider.imap.host = records[0].name;
|
provider.imap.host = records[0].name;
|
||||||
provider.imap.port = records[0].port;
|
provider.imap.port = records[0].port;
|
||||||
provider.imap.starttls = false;
|
provider.imap.starttls = false;
|
||||||
} catch (UnknownHostException ex) {
|
} catch (UnknownHostException ignored) {
|
||||||
// Identifies an IMAP server that MAY ... require the MUA to use the "STARTTLS" command
|
// Identifies an IMAP server that MAY ... require the MUA to use the "STARTTLS" command
|
||||||
DnsHelper.DnsRecord[] records = DnsHelper.lookup(context, "_imap._tcp." + domain, "srv");
|
DnsHelper.DnsRecord[] records = DnsHelper.lookup(context, "_imap._tcp." + domain, "srv");
|
||||||
if (records.length == 0)
|
if (records.length == 0)
|
||||||
|
@ -535,15 +535,24 @@ public class EmailProvider {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (discover == Discover.ALL || discover == Discover.SMTP) {
|
if (discover == Discover.ALL || discover == Discover.SMTP)
|
||||||
// Note that this covers connections both with and without Transport Layer Security (TLS)
|
try {
|
||||||
DnsHelper.DnsRecord[] records = DnsHelper.lookup(context, "_submission._tcp." + domain, "srv");
|
// Note that this covers connections both with and without Transport Layer Security (TLS)
|
||||||
if (records.length == 0)
|
DnsHelper.DnsRecord[] records = DnsHelper.lookup(context, "_submission._tcp." + domain, "srv");
|
||||||
throw new UnknownHostException(domain);
|
if (records.length == 0)
|
||||||
provider.smtp.host = records[0].name;
|
throw new UnknownHostException(domain);
|
||||||
provider.smtp.port = records[0].port;
|
provider.smtp.host = records[0].name;
|
||||||
provider.smtp.starttls = (provider.smtp.port == 587);
|
provider.smtp.port = records[0].port;
|
||||||
}
|
provider.smtp.starttls = (provider.smtp.port == 587);
|
||||||
|
} catch (UnknownHostException ignored) {
|
||||||
|
// https://tools.ietf.org/html/rfc8314
|
||||||
|
DnsHelper.DnsRecord[] records = DnsHelper.lookup(context, "_submissions._tcp." + domain, "srv");
|
||||||
|
if (records.length == 0)
|
||||||
|
throw new UnknownHostException(domain);
|
||||||
|
provider.smtp.host = records[0].name;
|
||||||
|
provider.smtp.port = records[0].port;
|
||||||
|
provider.smtp.starttls = false;
|
||||||
|
}
|
||||||
|
|
||||||
provider.validate();
|
provider.validate();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue