|
|
@ -149,12 +149,14 @@ 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
|
|
|
|
|
|
|
|
this.properties.put("mail." + this.protocol + ".ssl.checkserveridentity", "false");
|
|
|
|
InetAddress[] iaddrs = InetAddress.getAllByName(host);
|
|
|
|
InetAddress[] iaddrs = InetAddress.getAllByName(host);
|
|
|
|
if (iaddrs.length > 1)
|
|
|
|
if (iaddrs.length > 1)
|
|
|
|
for (InetAddress iaddr : iaddrs)
|
|
|
|
for (InetAddress iaddr : iaddrs)
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
|
|
|
|
Log.i("Falling back to " + iaddr.getHostAddress());
|
|
|
|
_connect(context, iaddr.getHostAddress(), port, user, password);
|
|
|
|
_connect(context, iaddr.getHostAddress(), port, user, password);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
} catch (MessagingException ex1) {
|
|
|
|
} catch (MessagingException ex1) {
|
|
|
|