MCPcopy Create free account
hub / github.com/M66B/FairEmail / checkMx

Method checkMx

app/src/main/java/eu/faircode/email/DnsHelper.java:117–130  ·  view source on GitHub ↗
(Context context, Address[] addresses)

Source from the content-addressed store, hash-verified

115 }
116
117 static void checkMx(Context context, Address[] addresses) throws UnknownHostException {
118 if (addresses == null)
119 return;
120
121 for (Address address : addresses) {
122 String email = ((InternetAddress) address).getAddress();
123 String domain = UriHelper.getEmailDomain(email);
124 if (domain == null)
125 continue;
126 DnsRecord[] records = _lookup(context, domain, "mx", CHECK_TIMEOUT);
127 if (records.length == 0)
128 throw new UnknownHostException(domain);
129 }
130 }
131
132 @NonNull
133 static DnsRecord[] lookup(Context context, String name, String type) {

Callers 4

checkMxMethod · 0.95
evaluateMethod · 0.95
synchronizeMessageMethod · 0.95
attachNetworkInfoMethod · 0.95

Calls 3

getEmailDomainMethod · 0.95
_lookupMethod · 0.95
getAddressMethod · 0.45

Tested by

no test coverage detected