oc-mail: Set sender on email messages without an orig recipient

But it has recipients. This is for sure happening with event
invitations messages.
pull/65/head
Enrique J. Hernández Blasco 2015-03-03 22:52:42 +01:00
parent acc2bd0369
commit 44dfd35521
2 changed files with 14 additions and 5 deletions

1
NEWS
View File

@ -7,6 +7,7 @@ Enhancements
- Appointment color and importance work now between Outlooks
Bug fixes
- Fix sender on importing email messages like event invitations
- Fix Outlook crashes when modifying the view of a folder
- Fix server side crash when reading some recurrence appointments

View File

@ -536,6 +536,7 @@ FillMessageHeadersFromProperties (NGMutableHashMap *headers,
NSDictionary *mailProperties, BOOL withBcc,
struct mapistore_connection_info *connInfo)
{
BOOL fromResolved = NO;
NSData *senderEntryId;
NSMutableString *subject;
NSString *from, *recId, *messageId, *subjectData, *recipientsStr;
@ -572,13 +573,15 @@ FillMessageHeadersFromProperties (NGMutableHashMap *headers,
list = MakeRecipientsList ([recipients objectForKey: @"orig"]);
if ([list count])
[headers setObjects: list forKey: @"from"];
{
[headers setObjects: list forKey: @"from"];
fromResolved = YES;
}
}
else
if (!fromResolved)
{
NSLog (@"Message without recipients."
@"Guessing recipients from PidTagSenderEntryId, PidTagOriginalDisplayTo"
@"and PidTagOriginalCc");
NSLog (@"Message without an orig from, try to guess it from PidTagSenderEntryId");
senderEntryId = [mailProperties objectForKey: MAPIPropertyKey (PR_SENDER_ENTRYID)];
if (senderEntryId)
{
@ -638,7 +641,12 @@ FillMessageHeadersFromProperties (NGMutableHashMap *headers,
}
}
}
if (!recipients)
{
NSLog (@"Message without recipients."
@"Guessing recipients from PidTagOriginalDisplayTo and PidTagOriginalCc");
recipientsStr = [mailProperties objectForKey: MAPIPropertyKey (PidTagOriginalDisplayTo)];
if (recipientsStr)
{