|
|
@ -436,7 +436,7 @@ public class EmailProvider implements Parcelable {
|
|
|
|
|
|
|
|
|
|
|
|
if (false) // Unsafe: the password could be sent to an unrelated email server
|
|
|
|
if (false) // Unsafe: the password could be sent to an unrelated email server
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
InetAddress iaddr = DnsHelper.getByName(context, domain.toLowerCase(Locale.ROOT));
|
|
|
|
InetAddress iaddr = InetAddress.getByName(domain.toLowerCase(Locale.ROOT));
|
|
|
|
List<String> commonNames =
|
|
|
|
List<String> commonNames =
|
|
|
|
ConnectionHelper.getCommonNames(context, domain.toLowerCase(Locale.ROOT), 443, SCAN_TIMEOUT);
|
|
|
|
ConnectionHelper.getCommonNames(context, domain.toLowerCase(Locale.ROOT), 443, SCAN_TIMEOUT);
|
|
|
|
EntityLog.log(context, "Website common names=" + TextUtils.join(",", commonNames));
|
|
|
|
EntityLog.log(context, "Website common names=" + TextUtils.join(",", commonNames));
|
|
|
@ -450,7 +450,7 @@ public class EmailProvider implements Parcelable {
|
|
|
|
|
|
|
|
|
|
|
|
if (!altName.equalsIgnoreCase(domain))
|
|
|
|
if (!altName.equalsIgnoreCase(domain))
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
InetAddress ialt = DnsHelper.getByName(context, altName);
|
|
|
|
InetAddress ialt = InetAddress.getByName(altName);
|
|
|
|
if (!ialt.equals(iaddr)) {
|
|
|
|
if (!ialt.equals(iaddr)) {
|
|
|
|
EntityLog.log(context, "Using website common name=" + altName);
|
|
|
|
EntityLog.log(context, "Using website common name=" + altName);
|
|
|
|
candidates.addAll(_fromDomain(context, altName.toLowerCase(Locale.ROOT), email, discover, intf));
|
|
|
|
candidates.addAll(_fromDomain(context, altName.toLowerCase(Locale.ROOT), email, discover, intf));
|
|
|
@ -509,7 +509,7 @@ public class EmailProvider implements Parcelable {
|
|
|
|
for (DnsHelper.DnsRecord record : records)
|
|
|
|
for (DnsHelper.DnsRecord record : records)
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
String target = record.response.toLowerCase(Locale.ROOT);
|
|
|
|
String target = record.response.toLowerCase(Locale.ROOT);
|
|
|
|
DnsHelper.getByName(context, target);
|
|
|
|
InetAddress.getByName(target);
|
|
|
|
|
|
|
|
|
|
|
|
EmailProvider mx1 = new EmailProvider(domain);
|
|
|
|
EmailProvider mx1 = new EmailProvider(domain);
|
|
|
|
mx1.imap.score = 0;
|
|
|
|
mx1.imap.score = 0;
|
|
|
@ -1340,7 +1340,7 @@ public class EmailProvider implements Parcelable {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public Boolean call() {
|
|
|
|
public Boolean call() {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
for (InetAddress iaddr : DnsHelper.getAllByName(context, host)) {
|
|
|
|
for (InetAddress iaddr : InetAddress.getAllByName(host)) {
|
|
|
|
InetSocketAddress address = new InetSocketAddress(iaddr, Server.this.port);
|
|
|
|
InetSocketAddress address = new InetSocketAddress(iaddr, Server.this.port);
|
|
|
|
|
|
|
|
|
|
|
|
SocketFactory factory = (starttls
|
|
|
|
SocketFactory factory = (starttls
|
|
|
@ -1380,7 +1380,7 @@ public class EmailProvider implements Parcelable {
|
|
|
|
String similar = name;
|
|
|
|
String similar = name;
|
|
|
|
if (similar.startsWith("*."))
|
|
|
|
if (similar.startsWith("*."))
|
|
|
|
similar = similar.substring(2);
|
|
|
|
similar = similar.substring(2);
|
|
|
|
InetAddress isimilar = DnsHelper.getByName(context, similar);
|
|
|
|
InetAddress isimilar = InetAddress.getByName(similar);
|
|
|
|
if (iaddr.equals(isimilar)) {
|
|
|
|
if (iaddr.equals(isimilar)) {
|
|
|
|
score += 1;
|
|
|
|
score += 1;
|
|
|
|
EntityLog.log(context, "Similar " + similar + " host=" + host);
|
|
|
|
EntityLog.log(context, "Similar " + similar + " host=" + host);
|
|
|
|