diff --git a/NEWS b/NEWS index 915438aee..14f96b5f1 100644 --- a/NEWS +++ b/NEWS @@ -27,7 +27,7 @@ Bug fixes - freebusy on web interface works again in multidomain environments (Zentyal) - fix double creation of folders in Outlook when the folder name starts with a digit (Zentyal) - avoid crashing Outlook after setting a custom view in a calendar folder (Zentyal) - + - handle emails having an attachment as their content 2.3.2 (2015-09-16) ------------------ diff --git a/SoObjects/Mailer/SOGoMailObject.m b/SoObjects/Mailer/SOGoMailObject.m index 1d44ddaa0..045de4149 100644 --- a/SoObjects/Mailer/SOGoMailObject.m +++ b/SoObjects/Mailer/SOGoMailObject.m @@ -389,8 +389,11 @@ static BOOL debugSoParts = NO; [[[info valueForKey: @"subtype"] lowercaseString] isEqualToString: @"calendar"]) return info; - if ([[[info valueForKey: @"type"] lowercaseString] isEqualToString: @"application"] && - [[[info valueForKey: @"subtype"] lowercaseString] isEqualToString: @"pkcs7-mime"]) + // deal with mails that contain only an attachment, for example: + // application/pkcs7-mime + // application/pdf + // etc. + if ([[[info valueForKey: @"type"] lowercaseString] isEqualToString: @"application"]) return info; /* @@ -1044,6 +1047,14 @@ static BOOL debugSoParts = NO; return obj; } } + // Handles cases where the email is itself an attachment, so its Content-Type + // is application/*, image/* etc. + else if ([_key isEqualToString: @"asAttachment"] && + (obj = [self lookupImap4BodyPartKey: @"0" inContext:_ctx]) != nil) + { + [obj setAsAttachment]; + return obj; + } /* return 404 to stop acquisition */ return [NSException exceptionWithHTTPStatus:404 /* Not Found */