From a4d9115d649565684df6e59472ab3771f750ced7 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Mon, 24 Apr 2017 12:42:20 +0200 Subject: [PATCH] Try to fix identity with no domain set while sending mail out --- mail/inc/class.mail_compose.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mail/inc/class.mail_compose.inc.php b/mail/inc/class.mail_compose.inc.php index 04562a11d0..07e44c47ed 100644 --- a/mail/inc/class.mail_compose.inc.php +++ b/mail/inc/class.mail_compose.inc.php @@ -2285,7 +2285,9 @@ class mail_compose { error_log(__METHOD__.__LINE__.' Faking From/SenderInfo for '.$activeMailProfile['ident_email'].' with ID:'.$activeMailProfile['ident_id'].'. Identitiy to use for sending:'.array2string($_identity)); } - $_mailObject->setFrom($_identity['ident_email'] ? $_identity['ident_email'] : $activeMailProfile['ident_email'], + $email_From = $_identity['ident_email'] ? $_identity['ident_email'] : $activeMailProfile['ident_email']; + // Try to fix identity email with no domain part set + $_mailObject->setFrom(Mail::fixInvalidAliasAddress(Api\Accounts::id2name($_identity['account_id'], 'account_email'), $email_From), Mail::generateIdentityString($_identity,false)); $_mailObject->addHeader('X-Priority', $_formData['priority']);