diff --git a/NEWS b/NEWS index fb50d675c..1e52e5b9b 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,7 @@ Bug fixes - fixed error with new user default sorting value for the mailer module (#2952) - fixed ActiveSync PING command flooding the server (#2940) - fixed many interop issues with Windows Phones over ActiveSync + - fixed automatic return receipts crash when not in the recepient list (#2965) 2.2.9a (2014-09-29) ------------------- diff --git a/UI/MailerUI/UIxMailView.m b/UI/MailerUI/UIxMailView.m index 371a2a504..8b6ec9218 100644 --- a/UI/MailerUI/UIxMailView.m +++ b/UI/MailerUI/UIxMailView.m @@ -315,6 +315,15 @@ static NSString *mailETag = nil; [matchingIdentityEMail retain]; } } + + if (!matchingIdentityEMail) + { + // This can happen if we receive the message because we are + // in the list of bcc. In this case, we take the first + // identity associated with the account. + matchingIdentityEMail = [[[[[self clientObject] mailAccountFolder] identities] lastObject] objectForKey: @"email"]; + RETAIN(matchingIdentityEMail); + } } return matchingIdentityEMail; @@ -487,13 +496,18 @@ static NSString *mailETag = nil; - (NGHashMap *) _receiptMessageHeaderTo: (NSString *) email { + NSString *subject, *from; NGMutableHashMap *map; - NSString *subject; map = [[NGMutableHashMap alloc] initWithCapacity: 1]; [map autorelease]; [map setObject: email forKey: @"to"]; - [map setObject: [self _matchingIdentityEMail] forKey: @"from"]; + + from = [self _matchingIdentityEMail]; + + if (from) + [map setObject: from forKey: @"from"]; + [map setObject: @"multipart/report; report-type=disposition-notification" forKey: @"content-type"]; subject = [NSString stringWithFormat: