fix(eas): handle attachments of type message/rfc822 when sanitize emails (fixes #5427) (#304)

This commit is contained in:
tfux
2021-11-18 18:44:13 +01:00
committed by GitHub
parent 16de167524
commit 33b2406bf1

View File

@@ -427,7 +427,7 @@ struct GlobalObjectId {
body = [thePart body];
if ([body isKindOfClass: [NGMimeMultipartBody class]])
if ([body isKindOfClass: [NGMimeMultipartBody class]] || [body isKindOfClass: [NGMimeMessage class]])
{
[self _sanitizedMIMEPart: body
performed: b];
@@ -479,8 +479,7 @@ struct GlobalObjectId {
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]];