Use delivered/envelope/original for identity matching

pull/174/head
M66B 5 years ago
parent 6a4bda55d1
commit 870e87248d

@ -1078,7 +1078,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 *to*, *cc*, *bcc* and *from* addresses will be checked
For incoming messages the *to*, *cc*, *bcc*, *from* and *(X-)delivered/envelope/original-to* addresses will be checked
and for outgoing messages (drafts, outbox and sent) the *from* addresses will be checked.
The matched address will be shown as *via* in the addresses section.

@ -103,6 +103,7 @@ import javax.mail.MessagingException;
import javax.mail.Session;
import javax.mail.Store;
import javax.mail.UIDFolder;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import javax.mail.search.ComparisonTerm;
@ -2434,6 +2435,12 @@ class Core {
addresses.addAll(Arrays.asList(message.bcc));
if (message.from != null)
addresses.addAll(Arrays.asList(message.from));
if (message.deliveredto != null)
try {
addresses.add(new InternetAddress(message.deliveredto));
} catch (AddressException ex) {
Log.w(ex);
}
}
// Search for matching identity

Loading…
Cancel
Save