diff --git a/app/src/main/java/eu/faircode/email/EmailProvider.java b/app/src/main/java/eu/faircode/email/EmailProvider.java index 43439bb8b5..dcd32c87b2 100644 --- a/app/src/main/java/eu/faircode/email/EmailProvider.java +++ b/app/src/main/java/eu/faircode/email/EmailProvider.java @@ -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 candidates = new ArrayList<>(_fromDomain(context, domain.toLowerCase(Locale.ROOT), email, discover));