better control of error_log messages regarding the use of non standard identities while sending

This commit is contained in:
Klaus Leithoff 2011-07-28 11:24:09 +00:00
parent ddee9f61be
commit 8c2a149760

View File

@ -694,7 +694,7 @@
$_mailObject->CharSet = $this->displayCharset;
// you need to set the sender, if you work with different identities, since most smtp servers, dont allow
// sending in the name of someone else
if ($_identity->id != $activeMailProfile->id) error_log(__METHOD__.__LINE__.' Faking From/SenderInfo for '.$activeMailProfile->emailAddress.' with ID:'.$activeMailProfile->id.'. Identitiy to use for sending:'.array2string($_identity));
if ($_identity->id != $activeMailProfile->id && strtolower($activeMailProfile->emailAddress) != strtolower($_identity->emailAddress)) error_log(__METHOD__.__LINE__.' Faking From/SenderInfo for '.$activeMailProfile->emailAddress.' with ID:'.$activeMailProfile->id.'. Identitiy to use for sending:'.array2string($_identity));
$_mailObject->Sender = ($_identity->id<0 && $activeMailProfile->id < 0 ? $_identity->emailAddress : $activeMailProfile->emailAddress);
$_mailObject->From = $_identity->emailAddress;
$_mailObject->FromName = $_mailObject->EncodeHeader($_identity->realName);