mirror of https://github.com/M66B/FairEmail.git
Fallback with full timeout
This commit is contained in:
parent
ed701f5672
commit
b3b320a4ef
|
@ -431,18 +431,12 @@ public class EmailService implements AutoCloseable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String prop = "mail." + protocol + ".connectiontimeout";
|
|
||||||
String timeout = properties.getProperty(prop);
|
|
||||||
try {
|
try {
|
||||||
EntityLog.log(context, "Falling back to " + iaddr.getHostAddress());
|
EntityLog.log(context, "Falling back to " + iaddr.getHostAddress());
|
||||||
properties.put(prop, Integer.toString(DEFAULT_CONNECT_TIMEOUT / 2));
|
|
||||||
_connect(iaddr.getHostAddress(), port, user, password, factory);
|
_connect(iaddr.getHostAddress(), port, user, password, factory);
|
||||||
return;
|
return;
|
||||||
} catch (MessagingException ex1) {
|
} catch (MessagingException ex1) {
|
||||||
EntityLog.log(context, "Fallback ex=" + ex.getMessage());
|
EntityLog.log(context, "Fallback ex=" + ex.getMessage());
|
||||||
} finally {
|
|
||||||
if (timeout != null)
|
|
||||||
properties.put(prop, timeout);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Throwable ex1) {
|
} catch (Throwable ex1) {
|
||||||
|
|
Loading…
Reference in New Issue