|
|
@ -149,20 +149,22 @@ public class MailService implements AutoCloseable {
|
|
|
|
// throw new MailConnectException(new SocketConnectException("Debug", new Exception(), host, port, 0));
|
|
|
|
// throw new MailConnectException(new SocketConnectException("Debug", new Exception(), host, port, 0));
|
|
|
|
_connect(context, host, port, user, password);
|
|
|
|
_connect(context, host, port, user, password);
|
|
|
|
} catch (MailConnectException ex) {
|
|
|
|
} catch (MailConnectException ex) {
|
|
|
|
if (this.insecure)
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
// Some devices resolve IPv6 addresses while not having IPv6 connectivity
|
|
|
|
InetAddress[] iaddrs = InetAddress.getAllByName(host);
|
|
|
|
this.properties.put("mail." + this.protocol + ".ssl.checkserveridentity", "false");
|
|
|
|
if (iaddrs.length > 1)
|
|
|
|
InetAddress[] iaddrs = InetAddress.getAllByName(host);
|
|
|
|
for (InetAddress iaddr : iaddrs)
|
|
|
|
if (iaddrs.length > 1)
|
|
|
|
try {
|
|
|
|
for (InetAddress iaddr : iaddrs)
|
|
|
|
_connect(context, iaddr.getHostAddress(), port, user, password);
|
|
|
|
try {
|
|
|
|
return;
|
|
|
|
Log.i("Falling back to " + iaddr.getHostAddress());
|
|
|
|
} catch (MessagingException ex1) {
|
|
|
|
_connect(context, iaddr.getHostAddress(), port, user, password);
|
|
|
|
Log.w(ex1);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
} catch (MessagingException ex1) {
|
|
|
|
} catch (Throwable ex1) {
|
|
|
|
Log.w(ex1);
|
|
|
|
Log.w(ex1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (Throwable ex1) {
|
|
|
|
|
|
|
|
Log.w(ex1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
throw ex;
|
|
|
|
throw ex;
|
|
|
|
}
|
|
|
|
}
|
|
|
|