mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-15 00:15:27 +00:00
Monotone-Parent: ebefc72cf1f85cf9726bac12a387a3b5d92e0945
Monotone-Revision: bfe92d024d362b0f22f21f877f8e6518e00ab543 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-05-01T14:47:20
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
2012-05-01 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* SoObjects/Mailer/SOGoDraftObject.m
|
||||
(-bodyPartForAttachmentWithName:): attach rfc822 content as 8bit,
|
||||
since the "quoted-printable" encoder of SOPE is broken.
|
||||
|
||||
2012-04-30 Ludovic Marcotte <lmarcotte@inverse.ca>
|
||||
|
||||
* SoObjects/SOGo/SOGoDomainDefaults.{h,m} - added
|
||||
|
||||
@@ -1119,7 +1119,7 @@ static NSString *userAgent = nil;
|
||||
NGMimeBodyPart *bodyPart;
|
||||
NSString *s;
|
||||
NSData *content;
|
||||
BOOL attachAsString, force7bitText;
|
||||
BOOL attachAsString, attachAsRFC822;
|
||||
NSString *p;
|
||||
id body;
|
||||
|
||||
@@ -1134,7 +1134,7 @@ static NSString *userAgent = nil;
|
||||
return nil;
|
||||
}
|
||||
attachAsString = NO;
|
||||
force7bitText = NO;
|
||||
attachAsRFC822 = NO;
|
||||
|
||||
/* prepare header of body part */
|
||||
|
||||
@@ -1145,7 +1145,7 @@ static NSString *userAgent = nil;
|
||||
if ([s hasPrefix: @"text/plain"] || [s hasPrefix: @"text/html"])
|
||||
attachAsString = YES;
|
||||
else if ([s hasPrefix: @"message/rfc822"])
|
||||
force7bitText = YES;
|
||||
attachAsRFC822 = YES;
|
||||
}
|
||||
if ((s = [self contentDispositionForAttachmentWithName:_name]))
|
||||
{
|
||||
@@ -1181,28 +1181,25 @@ static NSString *userAgent = nil;
|
||||
Note: in OGo this is done in LSWImapMailEditor.m:2477. Apparently
|
||||
NGMimeFileData objects are not processed by the MIME generator!
|
||||
*/
|
||||
NSData *encoded;
|
||||
|
||||
content = [[NSData alloc] initWithContentsOfMappedFile:p];
|
||||
|
||||
if (force7bitText)
|
||||
if (attachAsRFC822)
|
||||
{
|
||||
encoded = [content dataByEncodingQuotedPrintable];
|
||||
[map setObject: @"quoted-printable"
|
||||
forKey: @"content-transfer-encoding"];
|
||||
[map setObject: @"8bit" forKey: @"content-transfer-encoding"];
|
||||
[map setObject: @"inline" forKey: @"content-disposition"];
|
||||
}
|
||||
else
|
||||
{
|
||||
encoded = [content dataByEncodingBase64];
|
||||
content = [content dataByEncodingBase64];
|
||||
[map setObject: @"base64" forKey: @"content-transfer-encoding"];
|
||||
}
|
||||
[map setObject:[NSNumber numberWithInt:[encoded length]]
|
||||
[map setObject:[NSNumber numberWithInt:[content length]]
|
||||
forKey: @"content-length"];
|
||||
[content release]; content = nil;
|
||||
|
||||
/* Note: the -init method will create a temporary file! */
|
||||
body = [[NGMimeFileData alloc] initWithBytes:[encoded bytes]
|
||||
length:[encoded length]];
|
||||
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