Updating domain mail creation to use the mailname_bounce variable for the first alias

This commit is contained in:
Steven Mondji-Lerider 2013-03-14 08:41:43 +00:00
parent dfbcd0d861
commit 813c953544
1 changed files with 12 additions and 2 deletions

View File

@ -852,12 +852,22 @@ ORDER BY
* @access private * @access private
*/ */
function hook_dom_add_mx_domain($domain_id) { 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); $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 );
} }
/* ----------------------------------------------------------------- */ /* ----------------------------------------------------------------- */
/** hook function called by AlternC-upnp to know which open /** hook function called by AlternC-upnp to know which open
* tcp or udp ports this class requires or suggests * tcp or udp ports this class requires or suggests