Monotone-Parent: 5e1d3b05e4ac96fabc257b4fb753b7c7439c8337
Monotone-Revision: facc7e6b6f1dbd15663b7472ae5447106a067e21 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-03-10T04:44:31 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
dda2e52551
commit
e01985e910
|
@ -1,5 +1,9 @@
|
|||
2012-03-09 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* OpenChange/MAPIStoreMailVolatileMessage.m (-submitWithFlags:):
|
||||
skip any message that is not of class "IPM.Note", in order to
|
||||
avoid sending invitations or responses.
|
||||
|
||||
* SoObjects/Mailer/SOGoMailFolder.m (-renameTo:): reset the
|
||||
imap4URL to nil and change the nameInContainer after a successful
|
||||
operation.
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue