From 89ae27ac5e42bbadf3af5ddb6449428e7afd36f9 Mon Sep 17 00:00:00 2001 From: Steven Mondji-Lerider Date: Thu, 14 Mar 2013 08:39:08 +0000 Subject: [PATCH] Updating domain mail creation to use the mailname_bounce variable for the first alias --- bureau/class/m_mail.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/bureau/class/m_mail.php b/bureau/class/m_mail.php index 1b52fd0a..880eb241 100644 --- a/bureau/class/m_mail.php +++ b/bureau/class/m_mail.php @@ -832,9 +832,18 @@ ORDER BY * @access private */ function hook_dom_add_mx_domain($domain_id) { - global $err, $mem, $L_FQDN; + global $err, $mem, $L_FQDN,$db; $err->log("mail","hook_dom_add_mx_domain",$domain_id); - return $this->create_alias($domain_id, 'postmaster', $mem->user['login'].'@'.$L_FQDN ); + + $db->query("SELECT value FROM variable where name='mailname_bounce';"); + if (!$db->next_record()) { + $err->raise("mail",_("The email %s does not exist, it can't be deleted"),$mail); + return false; + } + $mailname=$db->f("value"); + printvar($mailname); + + return $this->create_alias($domain_id, 'postmaster', $mem->user['login'].'@'.$mailname ); }