From bf990975a76c71a62f75935cd312d9cddbb389cc Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 22 Aug 2014 13:26:18 +0000 Subject: [PATCH] use smpt-username as sender, if available, but only if it is a full email address --- phpgwapi/inc/class.send.inc.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/phpgwapi/inc/class.send.inc.php b/phpgwapi/inc/class.send.inc.php index 01b5e90ce3..17ec5617a5 100644 --- a/phpgwapi/inc/class.send.inc.php +++ b/phpgwapi/inc/class.send.inc.php @@ -60,7 +60,9 @@ class send extends egw_mailer $this->Username = $account->acc_smtp_username; $this->Password = $account->acc_smtp_password; $this->defaultDomain = $account->acc_domain; - $this->Sender = $account->acc_smtp_username?$account->acc_smtp_username:emailadmin_account::rfc822($account); + // use smpt-username as sender, if available, but only if it is a full email address + $this->Sender = $account->acc_smtp_username && strpos($account->acc_smtp_username, '@') !== false ? + $account->acc_smtp_username : $account->acc_ident_email; $this->Hostname = $GLOBALS['egw_info']['server']['hostname']; @@ -82,7 +84,6 @@ class send extends egw_mailer $this->FromName = $GLOBALS['egw_info']['user']['account_fullname']; $this->From = $GLOBALS['egw_info']['user']['account_email']; - $this->Sender = ''; $this->AddCustomHeader('X-Mailer:eGroupWare (http://www.eGroupWare.org)'); }