(Context context, Address[] addresses)
| 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) { |
no test coverage detected