mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-04 10:39:25 +00:00
Match identities for sent messages
This commit is contained in:
parent
623ccaa522
commit
acba8b20f9
1 changed files with 4 additions and 2 deletions
|
@ -1870,16 +1870,18 @@ public class ServiceSynchronize extends LifecycleService {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (message == null) {
|
if (message == null) {
|
||||||
Address[] tos = helper.getTo();
|
Address[] tos = (folder.isOutgoing() ? helper.getFrom() : helper.getTo());
|
||||||
EntityIdentity identity = null;
|
EntityIdentity identity = null;
|
||||||
if (tos != null && tos.length > 0) {
|
if (tos != null && tos.length > 0) {
|
||||||
String to = ((InternetAddress) tos[0]).getAddress();
|
String to = ((InternetAddress) tos[0]).getAddress();
|
||||||
if (!TextUtils.isEmpty(to)) {
|
if (!TextUtils.isEmpty(to)) {
|
||||||
to = to.toLowerCase();
|
to = to.toLowerCase();
|
||||||
identity = db.identity().getIdentity(folder.account, to);
|
identity = db.identity().getIdentity(folder.account, to);
|
||||||
|
|
||||||
if (identity == null)
|
if (identity == null)
|
||||||
identity = db.identity().getIdentity(folder.account, Helper.canonicalAddress(to));
|
identity = db.identity().getIdentity(folder.account, Helper.canonicalAddress(to));
|
||||||
if (identity == null) {
|
|
||||||
|
if (identity == null && !folder.isOutgoing()) {
|
||||||
to = helper.getDeliveredTo();
|
to = helper.getDeliveredTo();
|
||||||
if (!TextUtils.isEmpty(to))
|
if (!TextUtils.isEmpty(to))
|
||||||
identity = db.identity().getIdentity(folder.account, to);
|
identity = db.identity().getIdentity(folder.account, to);
|
||||||
|
|
Loading…
Add table
Reference in a new issue