mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-28 03:46:00 +01:00
DNS check timeout
This commit is contained in:
@@ -47,6 +47,7 @@ import javax.mail.internet.InternetAddress;
|
||||
public class DnsHelper {
|
||||
// https://dns.watch/
|
||||
private static final String DEFAULT_DNS = "84.200.69.80";
|
||||
private static final int CHECK_TIMEOUT = 5; // seconds
|
||||
private static final int LOOKUP_TIMEOUT = 15; // seconds
|
||||
|
||||
static void checkMx(Context context, Address[] addresses) throws UnknownHostException {
|
||||
@@ -67,7 +68,7 @@ public class DnsHelper {
|
||||
boolean found = true;
|
||||
try {
|
||||
SimpleResolver resolver = new SimpleResolver(getDnsServer(context));
|
||||
resolver.setTimeout(LOOKUP_TIMEOUT);
|
||||
resolver.setTimeout(CHECK_TIMEOUT);
|
||||
Lookup lookup = new Lookup(domain, Type.MX);
|
||||
lookup.setResolver(resolver);
|
||||
lookup.run();
|
||||
|
||||
Reference in New Issue
Block a user