mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-24 15:11:03 +00:00
Simplification
This commit is contained in:
parent
996ae80876
commit
c0d49d6f47
1 changed files with 8 additions and 4 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue