mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-11 00:08:51 +00:00
fix(mail): encode text MIME parts in quoted-printable
This will limit each line to a maximum of 70 characters. Fixes #5376
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#import <NGObjWeb/WOContext+SoObjects.h>
|
||||
#import <NGObjWeb/WORequest+So.h>
|
||||
#import <NGExtensions/NGBase64Coding.h>
|
||||
#import <NGExtensions/NGQuotedPrintableCoding.h>
|
||||
#import <NGExtensions/NSFileManager+Extensions.h>
|
||||
#import <NGExtensions/NGHashMap.h>
|
||||
#import <NGExtensions/NSNull+misc.h>
|
||||
@@ -1270,11 +1271,12 @@ static NSString *userAgent = nil;
|
||||
map = [[[NGMutableHashMap alloc] initWithCapacity: 1] autorelease];
|
||||
|
||||
[map setObject: contentTypeValue forKey: @"content-type"];
|
||||
[map setObject: @"quoted-printable" forKey: @"content-transfer-encoding"];
|
||||
|
||||
/* prepare body content */
|
||||
bodyPart = [[[NGMimeBodyPart alloc] initWithHeader:map] autorelease];
|
||||
|
||||
plainText = [text htmlToText];
|
||||
plainText = [[text htmlToText] stringByEncodingQuotedPrintable];
|
||||
[bodyPart setBody: plainText];
|
||||
|
||||
return bodyPart;
|
||||
@@ -1297,12 +1299,15 @@ static NSString *userAgent = nil;
|
||||
|
||||
// TODO: set charset in header!
|
||||
if (text)
|
||||
[map setObject: (isHTML ? htmlContentTypeValue : contentTypeValue)
|
||||
forKey: @"content-type"];
|
||||
{
|
||||
[map setObject: (isHTML ? htmlContentTypeValue : contentTypeValue)
|
||||
forKey: @"content-type"];
|
||||
[map setObject: @"quoted-printable" forKey: @"content-transfer-encoding"];
|
||||
}
|
||||
|
||||
/* prepare body content */
|
||||
bodyPart = [[[NGMimeBodyPart alloc] initWithHeader:map] autorelease];
|
||||
[bodyPart setBody: text];
|
||||
[bodyPart setBody: [text stringByEncodingQuotedPrintable]];
|
||||
|
||||
return bodyPart;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user