mirror of https://github.com/M66B/FairEmail.git
Simplification
This commit is contained in:
parent
996ae80876
commit
c0d49d6f47
|
@ -24,7 +24,6 @@ import java.net.UnknownHostException;
|
|||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.mail.Address;
|
||||
import javax.mail.internet.InternetAddress;
|
||||
|
@ -299,9 +298,14 @@ public class ConnectionHelper {
|
|||
for (Address address : addresses)
|
||||
try {
|
||||
String email = ((InternetAddress) address).getAddress();
|
||||
if (email == null || !email.contains("@"))
|
||||
if (email == null)
|
||||
continue;
|
||||
String domain = email.split("@")[1];
|
||||
|
||||
int d = email.lastIndexOf("@");
|
||||
if (d < 0)
|
||||
continue;
|
||||
|
||||
String domain = email.substring(d + 1);
|
||||
Lookup lookup = new Lookup(domain, Type.MX);
|
||||
SimpleResolver resolver = new SimpleResolver(ConnectionHelper.getDnsServer(context));
|
||||
lookup.setResolver(resolver);
|
||||
|
@ -346,7 +350,7 @@ public class ConnectionHelper {
|
|||
return null;
|
||||
}
|
||||
|
||||
static String getDomain(String host) {
|
||||
static String getDomain(String host) {
|
||||
if (host != null) {
|
||||
String[] h = host.split("\\.");
|
||||
if (h.length >= 2)
|
||||
|
|
Loading…
Reference in New Issue