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];