mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-03-03 06:06:24 +00:00
Monotone-Parent: 5e1d3b05e4ac96fabc257b4fb753b7c7439c8337
Monotone-Revision: facc7e6b6f1dbd15663b7472ae5447106a067e21 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-03-10T04:44:31 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -774,50 +774,55 @@ MakeMessageBody (NSDictionary *mailProperties, NSDictionary *attachmentParts,
|
||||
NSData *messageData;
|
||||
NSMutableArray *recipientEmails;
|
||||
NSArray *list;
|
||||
NSString *recId;
|
||||
NSString *recId, *from, *msgClass;
|
||||
NSUInteger count;
|
||||
struct mapistore_connection_info *connInfo;
|
||||
SOGoUser *activeUser;
|
||||
NSString *from;
|
||||
// SOGoMailFolder *sentFolder;
|
||||
SOGoDomainDefaults *dd;
|
||||
NSException *error;
|
||||
MAPIStoreMapping *mapping;
|
||||
|
||||
/* send mail */
|
||||
|
||||
messageData = [self _generateMailDataWithBcc: NO];
|
||||
|
||||
mailProperties = [sogoObject properties];
|
||||
recipientEmails = [NSMutableArray arrayWithCapacity: 32];
|
||||
recipients = [mailProperties objectForKey: @"recipients"];
|
||||
for (count = 0; count < 3; count++)
|
||||
msgClass = [mailProperties objectForKey: MAPIPropertyKey (PidTagMessageClass)];
|
||||
if ([msgClass isEqualToString: @"IPM.Note"]) /* we skip invitation replies */
|
||||
{
|
||||
recId = recTypes[count];
|
||||
list = [recipients objectForKey: recId];
|
||||
[recipientEmails
|
||||
addObjectsFromArray: [list objectsForKey: @"email"
|
||||
notFoundMarker: nil]];
|
||||
}
|
||||
/* send mail */
|
||||
|
||||
connInfo = [[self context] connectionInfo];
|
||||
activeUser = [SOGoUser userWithLogin: [NSString stringWithUTF8String: connInfo->username]];
|
||||
messageData = [self _generateMailDataWithBcc: NO];
|
||||
|
||||
mailProperties = [sogoObject properties];
|
||||
recipientEmails = [NSMutableArray arrayWithCapacity: 32];
|
||||
recipients = [mailProperties objectForKey: @"recipients"];
|
||||
for (count = 0; count < 3; count++)
|
||||
{
|
||||
recId = recTypes[count];
|
||||
list = [recipients objectForKey: recId];
|
||||
[recipientEmails
|
||||
addObjectsFromArray: [list objectsForKey: @"email"
|
||||
notFoundMarker: nil]];
|
||||
}
|
||||
|
||||
[self logWithFormat: @"recipients: %@", recipientEmails];
|
||||
dd = [activeUser domainDefaults];
|
||||
from = [[activeUser allEmails] objectAtIndex: 0];
|
||||
error = [[SOGoMailer mailerWithDomainDefaults: dd]
|
||||
activeUser = [[self context] activeUser];
|
||||
|
||||
[self logWithFormat: @"recipients: %@", recipientEmails];
|
||||
dd = [activeUser domainDefaults];
|
||||
from = [[activeUser allEmails] objectAtIndex: 0];
|
||||
error = [[SOGoMailer mailerWithDomainDefaults: dd]
|
||||
sendMailData: messageData
|
||||
toRecipients: recipientEmails
|
||||
sender: from];
|
||||
if (error)
|
||||
[self logWithFormat: @"an error occurred: '%@'", error];
|
||||
if (error)
|
||||
[self logWithFormat: @"an error occurred: '%@'", error];
|
||||
|
||||
mapping = [self mapping];
|
||||
[mapping unregisterURLWithID: [self objectId]];
|
||||
[self setIsNew: NO];
|
||||
[properties removeAllObjects];
|
||||
[[self container] cleanupCaches];
|
||||
mapping = [self mapping];
|
||||
[mapping unregisterURLWithID: [self objectId]];
|
||||
[self setIsNew: NO];
|
||||
[properties removeAllObjects];
|
||||
[[self container] cleanupCaches];
|
||||
}
|
||||
else
|
||||
[self logWithFormat: @"skipping submit of message with class '%@'",
|
||||
msgClass];
|
||||
|
||||
return MAPISTORE_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user