Handle MX record not resolving

pull/172/head
M66B 6 years ago
parent c369c51f4f
commit 62fabef955

@ -221,21 +221,25 @@ public class EmailProvider {
} catch (Throwable ex) { } catch (Throwable ex) {
Log.w(ex); Log.w(ex);
// Retry at MX server addresses try {
Record[] records = lookupDNS(context, domain, Type.MX); // Retry at MX server addresses
for (Record record : records) { Record[] records = lookupDNS(context, domain, Type.MX);
String target = ((MXRecord) record).getTarget().toString(true); for (Record record : records) {
while (autoconfig == null && target != null && target.indexOf('.') > 0) { String target = ((MXRecord) record).getTarget().toString(true);
try { while (autoconfig == null && target != null && target.indexOf('.') > 0) {
autoconfig = _fromDomain(context, target.toLowerCase(Locale.ROOT), email, discover); try {
} catch (Throwable ex1) { autoconfig = _fromDomain(context, target.toLowerCase(Locale.ROOT), email, discover);
Log.w(ex1); } catch (Throwable ex1) {
int dot = target.indexOf('.'); Log.w(ex1);
target = target.substring(dot + 1); int dot = target.indexOf('.');
target = target.substring(dot + 1);
}
} }
if (autoconfig != null)
break;
} }
if (autoconfig != null) } catch (Throwable ex1) {
break; Log.w(ex1);
} }
if (autoconfig == null) if (autoconfig == null)

Loading…
Cancel
Save