fix(mail): encode text MIME parts in quoted-printable

This reverts commit 6cf3d99125.

Fixes #5378
This commit is contained in:
Francis Lachapelle
2021-08-25 14:36:55 -04:00
parent 124b4f8f73
commit 9e364c647f
+4 -9
View File
@@ -28,7 +28,6 @@
#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>
@@ -1271,12 +1270,11 @@ 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] stringByEncodingQuotedPrintable];
plainText = [text htmlToText];
[bodyPart setBody: plainText];
return bodyPart;
@@ -1299,15 +1297,12 @@ static NSString *userAgent = nil;
// TODO: set charset in header!
if (text)
{
[map setObject: (isHTML ? htmlContentTypeValue : contentTypeValue)
forKey: @"content-type"];
[map setObject: @"quoted-printable" forKey: @"content-transfer-encoding"];
}
[map setObject: (isHTML ? htmlContentTypeValue : contentTypeValue)
forKey: @"content-type"];
/* prepare body content */
bodyPart = [[[NGMimeBodyPart alloc] initWithHeader:map] autorelease];
[bodyPart setBody: [text stringByEncodingQuotedPrintable]];
[bodyPart setBody: text];
return bodyPart;
}