From a4358ab02b4b4de62dd0f8771a8cba68e7436f84 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 1 May 2012 18:38:40 +0000 Subject: [PATCH] Monotone-Parent: 0e5184582f5d3e24e8418e6c09048eb31dd79c83 Monotone-Revision: 546030b7b1310706d148f176ba3f7dfa1f1138b1 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-05-01T18:38:40 --- ChangeLog | 4 ++-- SoObjects/Mailer/SOGoDraftObject.m | 19 ++++--------------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 00b72deda..47e33fe24 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,8 +5,8 @@ up with the module name. * SoObjects/Mailer/SOGoDraftObject.m - (-bodyPartForAttachmentWithName:): attach rfc822 content as 8bit, - since the "quoted-printable" encoder of SOPE is broken. + (-bodyPartForAttachmentWithName:): attach rfc822 content as + with base64 encoding, just as any other non-text data. 2012-04-30 Ludovic Marcotte diff --git a/SoObjects/Mailer/SOGoDraftObject.m b/SoObjects/Mailer/SOGoDraftObject.m index b162a9ee1..b751f8171 100644 --- a/SoObjects/Mailer/SOGoDraftObject.m +++ b/SoObjects/Mailer/SOGoDraftObject.m @@ -1119,7 +1119,7 @@ static NSString *userAgent = nil; NGMimeBodyPart *bodyPart; NSString *s; NSData *content; - BOOL attachAsString, attachAsRFC822; + BOOL attachAsString; NSString *p; id body; @@ -1134,7 +1134,6 @@ static NSString *userAgent = nil; return nil; } attachAsString = NO; - attachAsRFC822 = NO; /* prepare header of body part */ @@ -1144,8 +1143,6 @@ static NSString *userAgent = nil; [map setObject:s forKey: @"content-type"]; if ([s hasPrefix: @"text/plain"] || [s hasPrefix: @"text/html"]) attachAsString = YES; - else if ([s hasPrefix: @"message/rfc822"]) - attachAsRFC822 = YES; } if ((s = [self contentDispositionForAttachmentWithName:_name])) { @@ -1182,24 +1179,16 @@ static NSString *userAgent = nil; NGMimeFileData objects are not processed by the MIME generator! */ content = [[NSData alloc] initWithContentsOfMappedFile:p]; + [content autorelease]; - if (attachAsRFC822) - { - [map setObject: @"8bit" forKey: @"content-transfer-encoding"]; - [map setObject: @"inline" forKey: @"content-disposition"]; - } - else - { - content = [content dataByEncodingBase64]; - [map setObject: @"base64" forKey: @"content-transfer-encoding"]; - } + content = [content dataByEncodingBase64]; + [map setObject: @"base64" forKey: @"content-transfer-encoding"]; [map setObject:[NSNumber numberWithInt:[content length]] forKey: @"content-length"]; /* Note: the -init method will create a temporary file! */ body = [[NGMimeFileData alloc] initWithBytes:[content bytes] length:[content length]]; - [content release]; content = nil; } bodyPart = [[[NGMimeBodyPart alloc] initWithHeader:map] autorelease];