Small improvement

This commit is contained in:
M66B 2019-07-30 08:00:30 +02:00
parent 773b5660ab
commit eaf3ea4a7c
1 changed files with 9 additions and 7 deletions

View File

@ -151,13 +151,15 @@ public class MailService implements AutoCloseable {
} catch (MailConnectException ex) {
if (this.insecure)
try {
for (InetAddress iaddr : InetAddress.getAllByName(host))
try {
_connect(context, iaddr.getHostAddress(), port, user, password);
return;
} catch (MessagingException ex1) {
Log.w(ex1);
}
InetAddress[] iaddrs = InetAddress.getAllByName(host);
if (iaddrs.length > 1)
for (InetAddress iaddr : iaddrs)
try {
_connect(context, iaddr.getHostAddress(), port, user, password);
return;
} catch (MessagingException ex1) {
Log.w(ex1);
}
} catch (Throwable ex1) {
Log.w(ex1);
}