* 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
This commit is contained in:
Klaus Leithoff 2014-06-10 14:44:25 +00:00
parent 0b851a622b
commit 9ad4dc5f98

View File

@ -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');