Beispiel #1
0
function ReloadPostfix($nohastables = false)
{
    $ldap = new clladp();
    $domains = $ldap->Hash_domains_table();
    $unix = new unix();
    $php5 = $unix->LOCATE_PHP5_BIN();
    if (is_array($domains)) {
        while (list($num, $ligne) = each($domains)) {
            $dom[] = $num;
        }
        $myOrigin = $dom[0];
    }
    if ($myOrigin == null) {
        if (!isset($GLOBALS["CLASS_USERS_MENUS"])) {
            $user = new usersMenus();
        } else {
            $user = $GLOBALS["CLASS_USERS_MENUS"];
        }
        $myOrigin = $user->hostname;
    }
    if ($myOrigin == null) {
        $myOrigin = "localhost.localdomain";
    }
    $postfix = $unix->find_program("postfix");
    $daemon_directory = $unix->LOCATE_POSTFIX_DAEMON_DIRECTORY();
    echo "Starting......: Postfix daemon directory \"{$daemon_directory}\"\n";
    postconf("daemon_directory", $daemon_directory);
    if ($myOrigin == null) {
        $myOrigin = "localhost.localdomain";
    }
    if (!$nohastables) {
        echo "Starting......: Postfix launch datases compilation...\n";
        buildtables_background();
    }
    postconf("myorigin", "{$myOrigin}");
    postconf("smtpd_delay_reject", "yes");
    $main = new maincf_multi("master", "master");
    $freeze_delivery_queue = $main->GET("freeze_delivery_queue");
    if ($freeze_delivery_queue == 1) {
        postconf("master_service_disable", "qmgr.fifo");
        postconf("in_flow_delay", "0");
    } else {
        postconf("master_service_disable", "");
        $in_flow_delay = $main->GET("in_flow_delay");
        if ($in_flow_delay == null) {
            $in_flow_delay = "1s";
        }
        postconf("in_flow_delay", $in_flow_delay);
    }
    echo "Starting......: Postfix Apply securities issues\n";
    appliSecu();
    echo "Starting......: Postfix Reloading ASSP\n";
    system("/usr/share/artica-postfix/bin/artica-install --reload-assp");
    echo "Starting......: Postfix reloading postfix master with \"{$postfix}\"\n";
    if (is_file($postfix)) {
        shell_exec("{$postfix} reload >/dev/null 2>&1");
        return;
    }
}
function ReloadPostfix()
{
    echo "Starting......: Postfix Compiling tables...\n";
    system(LOCATE_PHP5_BIN2() . " /usr/share/artica-postfix/exec.postfix.hashtables.php");
    shell_exec("{$GLOBALS["postconf"]} -e \"myorigin =\\\$mydomain \" >/dev/null 2>&1");
    shell_exec("{$GLOBALS["postconf"]} -e \"smtpd_delay_reject =no \" >/dev/null 2>&1");
    echo "Starting......: Postfix Apply securities issues\n";
    appliSecu();
    echo "Starting......: Postfix Reloading ASSP\n";
    system("/usr/share/artica-postfix/bin/artica-install --reload-assp");
    echo "Starting......: Postfix reloading postfix master\n";
    if (is_file("/usr/sbin/postfix")) {
        shell_exec("/usr/sbin/postfix reload");
        return;
    }
}