mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-31 20:25:38 +00:00
Check for empty addresses
This commit is contained in:
parent
d6824bdfcd
commit
c08f36f21c
1 changed files with 7 additions and 1 deletions
|
@ -1214,11 +1214,15 @@ public class MessageHelper {
|
|||
header = header.replaceAll("\\?=[\\r\\n\\t ]+=\\?", "\\?==\\?");
|
||||
Address[] addresses = InternetAddress.parseHeader(header, false);
|
||||
|
||||
List<Address> result = new ArrayList<>();
|
||||
for (Address address : addresses) {
|
||||
InternetAddress iaddress = (InternetAddress) address;
|
||||
String email = iaddress.getAddress();
|
||||
String personal = iaddress.getPersonal();
|
||||
|
||||
if (TextUtils.isEmpty(email) && TextUtils.isEmpty(personal))
|
||||
continue;
|
||||
|
||||
email = decodeMime(email);
|
||||
if (!Helper.isSingleScript(email))
|
||||
email = punyCode(email);
|
||||
|
@ -1232,9 +1236,11 @@ public class MessageHelper {
|
|||
Log.w(ex);
|
||||
}
|
||||
}
|
||||
|
||||
result.add(address);
|
||||
}
|
||||
|
||||
return addresses;
|
||||
return (result.size() == 0 ? null : result.toArray(new Address[0]));
|
||||
}
|
||||
|
||||
Address[] getReturnPath() throws MessagingException {
|
||||
|
|
Loading…
Reference in a new issue