Fix recipients of reply message from Sent mailbox

Fixes #2625
This commit is contained in:
Francis Lachapelle
2016-06-01 16:22:25 -04:00
parent 908e47a25a
commit 40bc512318
2 changed files with 13 additions and 7 deletions

7
NEWS
View File

@@ -2,9 +2,10 @@
-------------------
Bug fixes
- sanity checks for events with bogus timezone offsets
- strip X- tags when securing content (#3695)
- when using EAS/ItemOperations, use IMAP PEEK operation
- [core] sanity checks for events with bogus timezone offsets
- [core] strip X- tags when securing content (#3695)
- [eas] when using EAS/ItemOperations, use IMAP PEEK operation
- [web] fixed recipients when replying from a message in the Sent mailbox (#2625)
2.3.11 (2016-05-12)
-------------------

View File

@@ -747,6 +747,7 @@ static NSString *userAgent = nil;
//
- (void) _fillInReplyAddresses: (NSMutableDictionary *) _info
replyToAll: (BOOL) _replyToAll
fromSentMailbox: (BOOL) _fromSentMailbox
envelope: (NGImap4Envelope *) _envelope
{
/*
@@ -758,8 +759,6 @@ static NSString *userAgent = nil;
Note: we cannot check reply-to, because Cyrus even sets a reply-to in the
envelope if none is contained in the message itself! (bug or
feature?)
TODO: what about sender (RFC 822 3.6.2)
*/
NSMutableArray *to, *addrs, *allRecipients;
NSArray *envelopeAddresses;
@@ -801,7 +800,9 @@ static NSString *userAgent = nil;
addrs = [NSMutableArray array];
envelopeAddresses = [_envelope replyTo];
if ([envelopeAddresses count])
if (_fromSentMailbox)
[addrs setArray: [_envelope to]];
else if ([envelopeAddresses count])
[addrs setArray: envelopeAddresses];
else
[addrs setArray: [_envelope from]];
@@ -973,17 +974,21 @@ static NSString *userAgent = nil;
- (void) fetchMailForReplying: (SOGoMailObject *) sourceMail
toAll: (BOOL) toAll
{
BOOL fromSentMailbox;
NSString *msgID;
NSMutableDictionary *info;
NGImap4Envelope *sourceEnvelope;
fromSentMailbox = [[sourceMail container] isKindOfClass: [SOGoSentFolder class]];
[sourceMail fetchCoreInfos];
info = [NSMutableDictionary dictionaryWithCapacity: 16];
[info setObject: [sourceMail subjectForReply] forKey: @"subject"];
sourceEnvelope = [sourceMail envelope];
[self _fillInReplyAddresses: info replyToAll: toAll
[self _fillInReplyAddresses: info
replyToAll: toAll
fromSentMailbox: fromSentMailbox
envelope: sourceEnvelope];
msgID = [sourceEnvelope messageID];
if ([msgID length] > 0)