diff --git a/SoObjects/Mailer/SOGoMailFolder.h b/SoObjects/Mailer/SOGoMailFolder.h index 0baa9798a..47278c3b8 100644 --- a/SoObjects/Mailer/SOGoMailFolder.h +++ b/SoObjects/Mailer/SOGoMailFolder.h @@ -95,7 +95,6 @@ typedef enum { - (BOOL) ensureSpoolFolderPath; - (id) appendMessage: (NSData *) message - inContext: (WOContext *) _ctx usingId: (int *) imap4id; @end diff --git a/SoObjects/Mailer/SOGoMailFolder.m b/SoObjects/Mailer/SOGoMailFolder.m index d93678dfa..0b57495f6 100644 --- a/SoObjects/Mailer/SOGoMailFolder.m +++ b/SoObjects/Mailer/SOGoMailFolder.m @@ -1119,7 +1119,8 @@ static NSString *spoolFolder = nil; if ([[result objectForKey: @"result"] boolValue]) { - *imap4id = [self IMAP4IDFromAppendResult: result]; + if (imap4id) + *imap4id = [self IMAP4IDFromAppendResult: result]; [client unselect]; } else @@ -1130,7 +1131,6 @@ static NSString *spoolFolder = nil; } - (id) appendMessage: (NSData *) message - inContext: (WOContext *) _ctx usingId: (int *) imap4id { NSException *error; @@ -1143,7 +1143,7 @@ static NSString *spoolFolder = nil; response = (WOResponse *) error; else { - response = [_ctx response]; + response = [context response]; [response setStatus: 201]; location = [NSString stringWithFormat: @"%@%d.eml", [self davURL], *imap4id]; @@ -1167,7 +1167,6 @@ static NSString *spoolFolder = nil; { rq = [_ctx request]; response = [self appendMessage: [rq content] - inContext: _ctx usingId: &imap4id]; } diff --git a/SoObjects/Mailer/SOGoMailObject.m b/SoObjects/Mailer/SOGoMailObject.m index fb5576de8..7af52044a 100644 --- a/SoObjects/Mailer/SOGoMailObject.m +++ b/SoObjects/Mailer/SOGoMailObject.m @@ -1262,7 +1262,6 @@ static BOOL debugSoParts = NO; reason: @"Can't overwrite messages"]; else response = [folder appendMessage: [rq content] - inContext: _ctx usingId: &imap4id]; } @@ -1310,7 +1309,6 @@ static BOOL debugSoParts = NO; - (NSString *) _emailAddressesFrom: (NSArray *) enveloppeAddresses { - //voir spec NSMutableArray *addresses; NSString *rc; NGImap4EnvelopeAddress *address; @@ -1404,7 +1402,9 @@ static BOOL debugSoParts = NO; range = [value rangeOfString: @"received:" options: NSCaseInsensitiveSearch range: NSMakeRange (10, [value length]-11)]; - if (range.length) + if (range.length + && range.location < [value length] + && range.length < [value length]) { // We want to keep the first part range.length = range.location;