mirror of https://github.com/M66B/FairEmail.git
Check for duplicate Return-Path headers
This commit is contained in:
parent
00edea51f2
commit
1c29bed5d4
|
@ -1257,7 +1257,23 @@ public class MessageHelper {
|
|||
}
|
||||
|
||||
Address[] getReturnPath() throws MessagingException {
|
||||
return getAddressHeader("Return-Path");
|
||||
Address[] addresses = getAddressHeader("Return-Path");
|
||||
if (addresses == null)
|
||||
return null;
|
||||
|
||||
List<Address> result = new ArrayList<>();
|
||||
for (int i = 0; i < addresses.length; i++) {
|
||||
boolean duplicate = false;
|
||||
for (int j = 0; j < i; j++)
|
||||
if (addresses[i].equals(addresses[j])) {
|
||||
duplicate = true;
|
||||
break;
|
||||
}
|
||||
if (!duplicate)
|
||||
result.add(addresses[i]);
|
||||
}
|
||||
|
||||
return result.toArray(new Address[0]);
|
||||
}
|
||||
|
||||
Address[] getSender() throws MessagingException {
|
||||
|
|
Loading…
Reference in New Issue