Revert "Use delivered to header for identity matching"

This reverts commit 842cab974e.
pull/155/head
M66B 6 years ago
parent 4c25c3c397
commit 96e9930e1c

@ -704,7 +704,7 @@ Note that this is independent of receiving messages.
**(34) How are identities matched?**
Identities are as expected matched by account.
For incoming messages the (delivered) *to* and *cc* address will be checked and for outgoing messages the *from* addresses will be checked.
For incoming messages the *to* and *cc* address will be checked and for outgoing messages the *from* addresses will be checked.
Archived messages will be considered as incoming messages, but additionally the *from* address will be checked.
The matched address will be shown as *via* in the addresses section.

@ -75,7 +75,6 @@ import javax.mail.Session;
import javax.mail.Store;
import javax.mail.StoreClosedException;
import javax.mail.UIDFolder;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import javax.mail.search.ComparisonTerm;
@ -1144,7 +1143,6 @@ class Core {
}
if (message == null) {
String deliveredto = helper.getDeliveredTo();
Address[] froms = helper.getFrom();
Address[] tos = helper.getTo();
Address[] ccs = helper.getCc();
@ -1155,13 +1153,6 @@ class Core {
if (froms != null)
addresses.addAll(Arrays.asList(froms));
} else {
if (deliveredto != null)
try {
for (Address address : InternetAddress.parse(deliveredto))
addresses.add(address);
} catch (AddressException ex) {
Log.w(ex);
}
if (tos != null)
addresses.addAll(Arrays.asList(tos));
if (ccs != null)
@ -1204,7 +1195,7 @@ class Core {
message.references = TextUtils.join(" ", helper.getReferences());
message.inreplyto = helper.getInReplyTo();
// Local address contains control or whitespace in string ``mailing list someone@example.org''
message.deliveredto = deliveredto;
message.deliveredto = helper.getDeliveredTo();
message.thread = helper.getThreadId(context, account.id, uid);
message.receipt_request = helper.getReceiptRequested();
message.receipt_to = helper.getReceiptTo();

@ -449,10 +449,7 @@ public class MessageHelper {
}
String getDeliveredTo() throws MessagingException {
String header = imessage.getHeader("Delivered-To", null);
if (header == null)
header = imessage.getHeader("X-Delivered-To", null);
return header;
return imessage.getHeader("Delivered-To", imessage.getHeader("X-Delivered-To", null));
}
String getInReplyTo() throws MessagingException {

Loading…
Cancel
Save