mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-04 06:20:26 +00:00
Cleanup
This commit is contained in:
parent
ec6b58697e
commit
dec9f9c4fa
1 changed files with 0 additions and 26 deletions
|
@ -91,18 +91,6 @@ public class DnsHelper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static InetAddress lookupMx(Context context, String domain) {
|
|
||||||
try {
|
|
||||||
DnsRecord[] records = lookup(context, domain, "mx");
|
|
||||||
if (records.length > 0)
|
|
||||||
return InetAddress.getByName(records[0].name);
|
|
||||||
} catch (Throwable ex) {
|
|
||||||
Log.w(ex);
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
static DnsRecord[] lookup(Context context, String name, String type) throws UnknownHostException {
|
static DnsRecord[] lookup(Context context, String name, String type) throws UnknownHostException {
|
||||||
int rtype;
|
int rtype;
|
||||||
|
@ -284,18 +272,4 @@ public class DnsHelper {
|
||||||
this.port = port;
|
this.port = port;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test(Context context) {
|
|
||||||
try {
|
|
||||||
String domain = "gmail.com";
|
|
||||||
checkMx(context, new Address[]{Log.myAddress()});
|
|
||||||
InetAddress iaddr = lookupMx(context, domain);
|
|
||||||
DnsRecord[] records = DnsHelper.lookup(context, "_imaps._tcp." + domain, "srv");
|
|
||||||
if (records.length == 0)
|
|
||||||
throw new UnknownHostException(domain);
|
|
||||||
Log.i("DNS iaddr=" + iaddr + " srv=" + records[0].name + ":" + records[0].port);
|
|
||||||
} catch (Throwable ex) {
|
|
||||||
Log.e("DNS", ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue