mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-12 00:49:04 +01:00
* Mail: prefer identity email over SMTP username for Return-Path header, if both are from the same domain
This commit is contained in:
parent
5aef3df2e8
commit
5207095b7d
@ -144,8 +144,10 @@ class Mailer extends Horde_Mime_Mail
|
||||
}
|
||||
|
||||
// use smpt-username as sender/return-path, if available, but only if it is a full email address
|
||||
$sender = $this->account->acc_smtp_username && strpos($this->account->acc_smtp_username, '@') !== false ?
|
||||
$this->account->acc_smtp_username : $identity['ident_email'];
|
||||
$sender = $this->account->acc_smtp_username && strpos($this->account->acc_smtp_username, '@') === false ||
|
||||
// if both are from the same domain, prefer the identity email over the smtp-username
|
||||
explode('@', $identity['ident_email'])[1] === explode('@', $this->account->acc_smtp_username)[1] ?
|
||||
$identity['ident_email'] : $this->account->acc_smtp_username;
|
||||
$this->addHeader('Return-Path', '<'.$sender.'>', true);
|
||||
|
||||
$this->setFrom($identity['ident_email'], $identity['ident_realname']);
|
||||
|
Loading…
Reference in New Issue
Block a user