fixed From's full name over EAS
parent
70e45f7843
commit
f4c4f5af62
|
@ -2159,6 +2159,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
NGMimeMessage *message;
|
NGMimeMessage *message;
|
||||||
NSException *error;
|
NSException *error;
|
||||||
NSData *data;
|
NSData *data;
|
||||||
|
NGMutableHashMap *map;
|
||||||
|
NGMimeMessage *messageToSend;
|
||||||
|
NGMimeMessageGenerator *generator;
|
||||||
|
NSDictionary *identity;
|
||||||
|
NSString *fullName, *email;
|
||||||
|
|
||||||
// We get the mail's data
|
// We get the mail's data
|
||||||
data = [[[[(id)[theDocumentElement getElementsByTagName: @"MIME"] lastObject] textValue] stringByDecodingBase64] dataUsingEncoding: NSUTF8StringEncoding];
|
data = [[[[(id)[theDocumentElement getElementsByTagName: @"MIME"] lastObject] textValue] stringByDecodingBase64] dataUsingEncoding: NSUTF8StringEncoding];
|
||||||
|
@ -2168,6 +2173,24 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
message = [parser parsePartFromData: data];
|
message = [parser parsePartFromData: data];
|
||||||
RELEASE(parser);
|
RELEASE(parser);
|
||||||
|
|
||||||
|
map = [NGHashMap hashMapWithDictionary: [message headers]];
|
||||||
|
|
||||||
|
identity = [[context activeUser] primaryIdentity];
|
||||||
|
|
||||||
|
fullName = [identity objectForKey: @"fullName"];
|
||||||
|
email = [identity objectForKey: @"email"];
|
||||||
|
if ([fullName length])
|
||||||
|
[map setObject: [NSString stringWithFormat: @"%@ <%@>", fullName, email] forKey: @"from"];
|
||||||
|
else
|
||||||
|
[map setObject: email forKey: @"from"];
|
||||||
|
|
||||||
|
messageToSend = [[[NGMimeMessage alloc] initWithHeader: map] autorelease];
|
||||||
|
|
||||||
|
[messageToSend setBody: [message body]];
|
||||||
|
|
||||||
|
generator = [[[NGMimeMessageGenerator alloc] init] autorelease];
|
||||||
|
data = [generator generateMimeFromPart: messageToSend];
|
||||||
|
|
||||||
error = [self _sendMail: data
|
error = [self _sendMail: data
|
||||||
recipients: [message allRecipients]
|
recipients: [message allRecipients]
|
||||||
saveInSentItems: ([(id)[theDocumentElement getElementsByTagName: @"SaveInSentItems"] count] ? YES : NO)];
|
saveInSentItems: ([(id)[theDocumentElement getElementsByTagName: @"SaveInSentItems"] count] ? YES : NO)];
|
||||||
|
@ -2295,6 +2318,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
NSException *error;
|
NSException *error;
|
||||||
|
|
||||||
id body, bodyFromSmartForward;
|
id body, bodyFromSmartForward;
|
||||||
|
NSString *fullName, *email;
|
||||||
|
NSDictionary *identity;
|
||||||
|
|
||||||
userFolder = [[context activeUser] homeFolderInContext: context];
|
userFolder = [[context activeUser] homeFolderInContext: context];
|
||||||
accountsFolder = [userFolder lookupName: @"Mail" inContext: context acquire: NO];
|
accountsFolder = [userFolder lookupName: @"Mail" inContext: context acquire: NO];
|
||||||
|
@ -2318,6 +2343,15 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
map = [NGHashMap hashMapWithDictionary: [messageFromSmartForward headers]];
|
map = [NGHashMap hashMapWithDictionary: [messageFromSmartForward headers]];
|
||||||
[map setObject: @"multipart/mixed" forKey: @"content-type"];
|
[map setObject: @"multipart/mixed" forKey: @"content-type"];
|
||||||
|
|
||||||
|
identity = [[context activeUser] primaryIdentity];
|
||||||
|
|
||||||
|
fullName = [identity objectForKey: @"fullName"];
|
||||||
|
email = [identity objectForKey: @"email"];
|
||||||
|
if ([fullName length])
|
||||||
|
[map setObject: [NSString stringWithFormat: @"%@ <%@>", fullName, email] forKey: @"from"];
|
||||||
|
else
|
||||||
|
[map setObject: email forKey: @"from"];
|
||||||
|
|
||||||
messageToSend = [[[NGMimeMessage alloc] initWithHeader: map] autorelease];
|
messageToSend = [[[NGMimeMessage alloc] initWithHeader: map] autorelease];
|
||||||
body = [[[NGMimeMultipartBody alloc] initWithPart: messageToSend] autorelease];
|
body = [[[NGMimeMultipartBody alloc] initWithPart: messageToSend] autorelease];
|
||||||
|
|
||||||
|
|
1
NEWS
1
NEWS
|
@ -10,6 +10,7 @@ Bug fixes
|
||||||
- correctly recognize Apple Calendar on Yosemite (#2960)
|
- correctly recognize Apple Calendar on Yosemite (#2960)
|
||||||
- fixed two potential autorelease pool leak (#3026 and #3051)
|
- fixed two potential autorelease pool leak (#3026 and #3051)
|
||||||
- fixed birthday offset in EAS
|
- fixed birthday offset in EAS
|
||||||
|
- fixed From's full name over EAS
|
||||||
|
|
||||||
2.2.13 (2014-12-30)
|
2.2.13 (2014-12-30)
|
||||||
-------------------
|
-------------------
|
||||||
|
|
Loading…
Reference in New Issue