feat(mail): handle multiple mail identities

Fixes #5087
This commit is contained in:
Francis Lachapelle
2020-07-30 15:16:28 -04:00
parent 87cf5b473f
commit a8bbaf01d7

View File

@@ -692,7 +692,13 @@ static NSString *userAgent = nil;
if (_fromSentMailbox)
[self _addRecipients: [_envelope from] toArray: addrs];
else
[self _addRecipients: [_envelope to] toArray: addrs];
{
[self _addRecipients: [_envelope to] toArray: addrs];
if ([addrs count] == 0)
[self _addRecipients: [_envelope cc] toArray: addrs];
if ([addrs count] == 0)
[self _addRecipients: [_envelope bcc] toArray: addrs];
}
if ([addrs count])
{
@@ -707,6 +713,12 @@ static NSString *userAgent = nil;
[_info setObject: [self _emailFromIdentity: identity] forKey: @"from"];
}
}
else
{
identity = [[context activeUser] defaultIdentity];
if (identity)
[_info setObject: [self _emailFromIdentity: identity] forKey: @"from"];
}
}
//