mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-24 07:01:05 +00:00
Always fallback to connecting to IP addresses
This commit is contained in:
parent
f6a0e908e7
commit
f8397ea8b7
1 changed files with 16 additions and 14 deletions
|
@ -149,12 +149,14 @@ public class MailService implements AutoCloseable {
|
|||
// throw new MailConnectException(new SocketConnectException("Debug", new Exception(), host, port, 0));
|
||||
_connect(context, host, port, user, password);
|
||||
} catch (MailConnectException ex) {
|
||||
if (this.insecure)
|
||||
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);
|
||||
if (iaddrs.length > 1)
|
||||
for (InetAddress iaddr : iaddrs)
|
||||
try {
|
||||
Log.i("Falling back to " + iaddr.getHostAddress());
|
||||
_connect(context, iaddr.getHostAddress(), port, user, password);
|
||||
return;
|
||||
} catch (MessagingException ex1) {
|
||||
|
|
Loading…
Reference in a new issue