(fix) proper handling of file attachments in S/MIME encrypted mails

This commit is contained in:
Ludovic Marcotte
2018-01-05 13:55:05 -05:00
parent 2f1c8cdbc8
commit c875302a86
4 changed files with 118 additions and 32 deletions
+3 -18
View File
@@ -786,8 +786,8 @@ static BOOL debugSoParts = NO;
if ([prefix hasSuffix: @"/"])
prefix = [prefix substringToIndex: [prefix length] - 1];
[self _feedFileAttachmentIds: attachmentIds
withInfos: [coreInfos objectForKey: @"bodystructure"]
andPrefix: prefix];
withInfos: [coreInfos objectForKey: @"bodystructure"]
andPrefix: prefix];
return attachmentIds;
}
@@ -811,22 +811,7 @@ static BOOL debugSoParts = NO;
if (!filename)
{
// We might end up here because of MUA that actually strips the
// Content-Disposition (and thus, the filename) when mails containing
// attachments have been forwarded. Thunderbird (2.x) does just that
// when forwarding mails with images attached to them (using cid:...).
if ([mimeType hasPrefix: @"application/"] ||
[mimeType hasPrefix: @"audio/"] ||
[mimeType hasPrefix: @"image/"] ||
[mimeType hasPrefix: @"video/"])
{
filename = [NSString stringWithFormat: @"unknown_%@", path];
}
else
{
if ([mimeType isEqualToString: @"message/rfc822"])
filename = [NSString stringWithFormat: @"email_%@.eml", path];
}
filename = [mimeType asPreferredFilenameUsingPath: path];
}
if (filename)