diff --git a/SoObjects/Mailer/SOGoDraftObject.m b/SoObjects/Mailer/SOGoDraftObject.m index 109c21507..3ea17ca13 100644 --- a/SoObjects/Mailer/SOGoDraftObject.m +++ b/SoObjects/Mailer/SOGoDraftObject.m @@ -700,9 +700,9 @@ static NSString *userAgent = nil; [self _addRecipients: [_envelope bcc] toArray: addrs]; } + identity = nil; if ([addrs count]) { - identity = nil; for (i = 0; !identity && i < [addrs count]; i++) { email = [addrs objectAtIndex: i]; @@ -713,7 +713,7 @@ static NSString *userAgent = nil; [_info setObject: [self _emailFromIdentity: identity] forKey: @"from"]; } } - else + if (!identity) { identity = [[context activeUser] defaultIdentity]; if (identity) diff --git a/SoObjects/SOGo/SOGoUser.m b/SoObjects/SOGo/SOGoUser.m index 2d7f473f5..9c77a612f 100644 --- a/SoObjects/SOGo/SOGoUser.m +++ b/SoObjects/SOGo/SOGoUser.m @@ -348,7 +348,7 @@ NSString *defaultEmail; unsigned int count, max; - defaultEmail = [NSString stringWithFormat: @"%@@%@", [self loginInDomain], [self domain]]; + defaultEmail = [self systemEmail]; defaultAccount = [[self mailAccounts] objectAtIndex: 0]; defaultIdentity = nil;