From 9ad4dc5f98b9c9e75b022b0279bf5c0040c1aad1 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Tue, 10 Jun 2014 14:44:25 +0000 Subject: [PATCH] * Mail: if we use a different Identity on sending AND the identity email is different but not empty from the account email; then use identity information for From and FromName; Do not touch Sender; ToDo: discuss to set replyto accordingly --- mail/inc/class.mail_compose.inc.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/mail/inc/class.mail_compose.inc.php b/mail/inc/class.mail_compose.inc.php index be35360c09..669bd68730 100644 --- a/mail/inc/class.mail_compose.inc.php +++ b/mail/inc/class.mail_compose.inc.php @@ -2143,8 +2143,17 @@ 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->Sender = (!empty($_identity['ident_email'])? $_identity['ident_email'] : $activeMailProfile['ident_email']); - $_mailObject->From = $_identity['ident_email']; - $_mailObject->FromName = $_mailObject->EncodeHeader(mail_bo::generateIdentityString($_identity,false)); + if ($_signature && !empty($_signature['ident_email']) && $_identity['ident_email']!=$_signature['ident_email']) + { + error_log(__METHOD__.__LINE__.' Faking From for '.$activeMailProfile['ident_email'].' with ID:'.$activeMailProfile['ident_id'].'. Identitiy to use for sending:'.array2string($_signature)); + $_mailObject->From = $_signature['ident_email']; + $_mailObject->FromName = $_mailObject->EncodeHeader(mail_bo::generateIdentityString($_signature,false)); + } + else + { + $_mailObject->From = $_identity['ident_email']; + $_mailObject->FromName = $_mailObject->EncodeHeader(mail_bo::generateIdentityString($_identity,false)); + } $_mailObject->Priority = $_formData['priority']; $_mailObject->Encoding = 'quoted-printable'; $_mailObject->AddCustomHeader('X-Mailer: EGroupware-Mail');