Skip to content

Commit

Permalink
fix(eas): handle attachments of type message/rfc822 when sanitize ema…
Browse files Browse the repository at this point in the history
…ils (fixes #5427) (#304)
  • Loading branch information
tfux committed Nov 18, 2021
1 parent 16de167 commit 33b2406
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ActiveSync/SOGoMailObject+ActiveSync.m
Expand Up @@ -427,7 +427,7 @@ - (void) _sanitizedMIMEPart: (id) thePart

body = [thePart body];

if ([body isKindOfClass: [NGMimeMultipartBody class]])
if ([body isKindOfClass: [NGMimeMultipartBody class]] || [body isKindOfClass: [NGMimeMessage class]])
{
[self _sanitizedMIMEPart: body
performed: b];
Expand Down Expand Up @@ -479,8 +479,7 @@ - (void) _sanitizedMIMEPart: (id) thePart
RELEASE(fdata);
*b = YES;
}
else if ([[(NGMimeContentDispositionHeaderField *)[thePart headerForKey: @"content-disposition"] type] hasPrefix: @"attachment"] ||
[[(NGMimeContentDispositionHeaderField *)[thePart headerForKey: @"content-disposition"] type] hasPrefix: @"inline"])
else if ([body isKindOfClass: [NSData class]])
{
[thePart setHeader: @"base64" forKey: @"content-transfer-encoding"];
[thePart setBody: [body dataByEncodingBase64]];
Expand Down

0 comments on commit 33b2406

Please sign in to comment.