Find server by NS records

pull/209/head
M66B 2 years ago
parent 84f416fc00
commit 86b343eca0

@ -359,6 +359,18 @@ public class EmailProvider implements Parcelable {
return Arrays.asList(provider);
}
try {
DnsHelper.DnsRecord[] ns = DnsHelper.lookup(context, domain, "ns");
for (DnsHelper.DnsRecord record : ns)
for (EmailProvider provider : providers)
if (provider.mx != null)
for (String mx : provider.mx)
if (record.name.matches(mx))
return Arrays.asList(provider);
} catch (Throwable ex) {
Log.w(ex);
}
List<EmailProvider> candidates =
new ArrayList<>(_fromDomain(context, domain.toLowerCase(Locale.ROOT), email, discover));

Loading…
Cancel
Save