From c4fd99baa7a389604c7f8310a82bb32c3a264aad Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Mon, 25 Jul 2011 22:38:11 +0000 Subject: [PATCH] MailboxHandler.php: - use smtp_get_admin_email() to get the sender for the welcome mail - add a check for empty (shouldn't happen in theory) or 'CLI' username and use the mailbox address as fallback This is based on Dale's patch, but completely rewritten (what a big word for two lines of code ;-) Dale had only added the line if(empty($fFrom)) $fFrom = $this->username; My version is tested with CLI with both $CONF[admin_email] set and empty. This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF), https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583 git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1127 a1433add-5e2c-0410-b055-b7f2511e0802 --- model/MailboxHandler.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/model/MailboxHandler.php b/model/MailboxHandler.php index 87c47443..5631886b 100644 --- a/model/MailboxHandler.php +++ b/model/MailboxHandler.php @@ -198,7 +198,8 @@ class MailboxHandler { { # TODO: move "send the mail" to a function $fTo = $username; - $fFrom = Config::read('admin_email'); + $fFrom = smtp_get_admin_email(); + if(empty($fFrom) || $fFrom == 'CLI') $fFrom = $this->username; $fSubject = Lang::read('pSendmail_subject_text'); $fBody = Config::read('welcome_text');