function build_all_aliases() { MysqlInstancesList(); if (!is_array($GLOBALS["INSTANCES_LIST"])) { echo "Starting......: " . date("H:i:s") . " Postfix No instances, aborting\n"; return; } reset($GLOBALS["INSTANCES_LIST"]); while (list($num, $ligne) = each($GLOBALS["INSTANCES_LIST"])) { $hostname = $ligne; echo "Starting......: " . date("H:i:s") . " Postfix \"{$hostname}\" checking aliases\n"; $maincf = new maincf_multi($hostname); $maincf->buildconf(); $results = array(); exec("{$GLOBALS["postmulti"]} -i postfix-{$hostname} -p reload 2>&1", $results); while (list($a, $b) = each($results)) { echo "Starting......: " . date("H:i:s") . " Postfix \"{$hostname}\" {$b}\n"; } } }
function ConfigureMainCF($hostname) { if (strlen(trim($hostname)) < 3) { return null; } $users = new usersMenus(); $unix = new unix(); echo "Starting......: Postfix checking instance {$hostname}\n"; $instance_path = "/etc/postfix-{$hostname}"; if (!is_file("{$instance_path}/dynamicmaps.cf")) { echo "Starting......: Postfix {$hostname} creating dynamicmaps.cf\n"; @file_put_contents("{$instance_path}/dynamicmaps.cf", "#"); } $maincf = new maincf_multi($hostname); reconfigure_instance_mime_checks($myhostname); $maincf->buildconf(); $assp = new assp_multi($ou); if ($assp->AsspEnabled == 1) { shell_exec(LOCATE_PHP5_BIN2() . " " . dirname(__FILE__) . "/exec.assp-multi.php --org \"{$ou}\""); } shell_exec("{$GLOBALS["postmulti"]} -i postfix-{$hostname} -e enable"); _start_instance($hostname); }