mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-19 21:53:19 +00:00
Monotone-Parent: 0e5184582f5d3e24e8418e6c09048eb31dd79c83
Monotone-Revision: 546030b7b1310706d148f176ba3f7dfa1f1138b1 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-05-01T18:38:40
This commit is contained in:
@@ -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 <lmarcotte@inverse.ca>
|
||||
|
||||
|
||||
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user