Esempio n. 1
0
function PostfixAddMyNetwork()
{
    $main = new main_cf();
    $main->add_my_networks($_GET["PostfixAddMyNetwork"]);
    $sock = new sockets();
    $sock->getFrameWork("cmd.php?postfix-networks=yes");
}
function EditRelayhost()
{
    $main = new main_cf();
    $main->main_array["relayhost"] = $_GET["EditRelayhost"];
    $main->save_conf();
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body('{success}');
}
function PostFixVerifyDatabaseSaveParseOthers()
{
    $main = new main_cf();
    unset($_GET["address_verify_map"]);
    while (list($num, $ligne) = each($_GET)) {
        $main->main_array[$num] = $ligne;
    }
    $main->save_conf();
}
Esempio n. 4
0
function SaveForm()
{
    $main = new main_cf();
    while (list($num, $ligne) = each($_GET)) {
        $main->main_array[$num] = $ligne;
    }
    $main->save_conf();
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body('{success}');
}
function SaveForm()
{
    $main = new main_cf();
    while (list($num, $val) = each($_GET)) {
        writelogs("{$num}=\"{$val}\"", __FUNCTION__, __FILE__);
        $main->main_array[$num] = $val;
    }
    $main->save_conf();
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body('{success}');
}
function ajax_pop()
{
    $sock = new sockets();
    $main = new main_cf();
    $main->FillDefaults();
    $main->main_array["message_size_limit"] = $sock->GET_INFO("message_size_limit");
    $main->main_array["default_destination_recipient_limit"] = $sock->GET_INFO("default_destination_recipient_limit");
    $main->main_array["smtpd_recipient_limit"] = $sock->GET_INFO("smtpd_recipient_limit");
    $main->main_array["mime_nesting_limit"] = $sock->GET_INFO("mime_nesting_limit");
    $main->main_array["header_address_token_limit"] = $sock->GET_INFO("header_address_token_limit");
    $main->main_array["virtual_mailbox_limit"] = $sock->GET_INFO("virtual_mailbox_limit");
    $main->main_array["message_size_limit"] = $main->main_array["message_size_limit"] / 1024 / 1000;
    $main->main_array["virtual_mailbox_limit"] = $main->main_array["virtual_mailbox_limit"] / 1024 / 1000;
    $html = "\n\t\t\n\t\t<div id='messages_restriction_id'>\n\t\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t    <td nowrap class=legend style='font-size:13px'>{message_size_limit}</strong>:</td>\n\t\t\t    <td style='font-size:13px'>" . Field_text('message_size_limit', $main->main_array["message_size_limit"], 'width:60px;font-size:13px;padding:3px;text-align:right') . "&nbsp;MB</td>\n\t\t\t    <td>" . help_icon('{message_size_limit_text}') . "</td>\n\t\t</tr>\n\t\t\n\t\t\n\t<tr>\n\t\t\t    <td nowrap class=legend style='font-size:13px'>{default_destination_recipient_limit}</strong>:</td>\n\t\t\t    <td>" . Field_text('default_destination_recipient_limit', $main->main_array["default_destination_recipient_limit"], 'width:60px;font-size:13px;padding:3px;text-align:right') . "</td>\n\t\t\t     <td>" . help_icon('{default_destination_recipient_limit_text}') . "</td>\n\t</tr>\n\t\n\t<tr>\n\t\t\t    <td nowrap class=legend style='font-size:13px'>{smtpd_recipient_limit}</strong>:</td>\n\t\t\t    <td>" . Field_text('smtpd_recipient_limit', $main->main_array["smtpd_recipient_limit"], 'width:60px;font-size:13px;padding:3px;text-align:right') . "</td>\n\t\t\t     <td>" . help_icon('{smtpd_recipient_limit_text}') . "</td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t\t    <td nowrap class=legend style='font-size:13px'>{mime_nesting_limit}</strong>:</td>\n\t\t\t    <td>" . Field_text('mime_nesting_limit', $main->main_array["mime_nesting_limit"], 'width:60px;font-size:13px;padding:3px;text-align:right') . " </td>\n\t\t\t     <td>" . help_icon('{mime_nesting_limit_text}') . "</td>\n\t\t</tr>\n\t\t\n\t\t<tr>\n\t\t\t    <td nowrap class=legend style='font-size:13px'>{header_address_token_limit}</strong>:</td>\n\t\t\t    <td>" . Field_text('header_address_token_limit', $main->main_array["header_address_token_limit"], 'width:60px;font-size:13px;padding:3px;text-align:right') . " </td>\n\t\t\t     <td>" . help_icon('{header_address_token_limit_text}') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t    <td nowrap class=legend style='font-size:13px'>{virtual_mailbox_limit}</strong>:</td>\n\t\t\t    <td style='font-size:13px'>" . Field_text('virtual_mailbox_limit', $main->main_array["virtual_mailbox_limit"], 'width:60px;font-size:13px;padding:3px;text-align:right') . "&nbsp;MB </td>\n\t\t\t    <td>" . help_icon('{virtual_mailbox_limit_text}') . "</td>\n\t\t</tr>\n\t\t<tr><td colspan=2 align='rigth' style='padding-right:10px;text-align:right'>\n\t\t<hr>" . button("{apply}", "SaveMessagesRestrictions()") . "\n\t\t</td></tr>\n\t</table>\n\t</div>";
    $tpl = new templates();
    echo $tpl->_parse_body($html);
}
Esempio n. 7
0
function EditSasl()
{
    $main = new main_cf();
    if (isset($_GET["EditSasl"]) == "yes") {
        $main->smtp_sasl_password_maps_enable();
    } else {
        $main->smtp_sasl_password_maps_disable();
    }
}
Esempio n. 8
0
function smtpd_sasl_auth_enable()
{
    $main = new main_cf();
    $clientRestriction = new smtpd_restrictions();
    //smtpd_recipient_restrictions
    if ($_GET["smtpd_sasl_auth_enable"] == "no") {
        $clientRestriction->DeleteKey("permit_sasl_authenticated", "smtpd_recipient_restrictions");
    }
    if ($_GET["smtpd_sasl_auth_enable"] == "yes") {
        $clientRestriction->AddKey("permit_sasl_authenticated", 'smtpd_recipient_restrictions');
        $clientRestriction->AddKey("reject_unauth_destination", 'smtpd_recipient_restrictions');
    }
    $main->main_array["smtp_sender_dependent_authentication"] = $_GET["smtp_sender_dependent_authentication"];
    $main->main_array["smtpd_sasl_auth_enable"] = $_GET["smtpd_sasl_auth_enable"];
    $main->main_array["smtpd_sasl_authenticated_header"] = $_GET["smtpd_sasl_authenticated_header"];
    $main->save_conf();
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body('{success}');
}
Esempio n. 9
0
function mysql_action_enable_change()
{
    $enable = $_GET["changemysqlenable"];
    $artica = new artica_general();
    $artica->EnableMysqlFeatures = $enable;
    if ($enable == 0) {
        $main = new main_cf();
        $main->save_conf();
        $main->save_conf_to_server();
    }
    $artica->SaveMysqlSettings();
    $sock = new sockets();
    $datas = $sock->getfile('restartmysql');
    $datas = htmlentities($datas);
    $tbl = explode("\n", $datas);
    $datas = '';
    while (list($num, $val) = each($tbl)) {
        $datas = $datas . "<div>{$val}</div>";
    }
    echo "<div style='width:100%;height:500px;overflow:auto'>{$datas}</div>";
}
Esempio n. 10
0
function build()
{
    $unix = new unix();
    $sock = new sockets();
    $ClamavStreamMaxLength = $sock->GET_INFO("ClamavStreamMaxLength");
    $ClamavMaxRecursion = $sock->GET_INFO("ClamavMaxRecursion");
    $ClamavMaxFiles = $sock->GET_INFO("ClamavMaxFiles");
    $PhishingScanURLs = $sock->GET_INFO("PhishingScanURLs");
    $ClamavMaxScanSize = $sock->GET_INFO("ClamavMaxScanSize");
    $ClamavMaxFileSize = $sock->GET_INFO("ClamavMaxFileSize");
    $ClamavTemporaryDirectory = $sock->GET_INFO("ClamavTemporaryDirectory");
    if ($ClamavTemporaryDirectory == null) {
        $ClamavTemporaryDirectory = "/home/clamav";
    }
    if (!is_numeric($ClamavStreamMaxLength)) {
        $ClamavStreamMaxLength = 12;
    }
    if (!is_numeric($ClamavMaxRecursion)) {
        $ClamavMaxRecursion = 5;
    }
    if (!is_numeric($ClamavMaxFiles)) {
        $ClamavMaxFiles = 10000;
    }
    if (!is_numeric($PhishingScanURLs)) {
        $PhishingScanURLs = 1;
    }
    if (!is_numeric($ClamavMaxScanSize)) {
        $ClamavMaxScanSize = 15;
    }
    if (!is_numeric($ClamavMaxFileSize)) {
        $ClamavMaxFileSize = 20;
    }
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} MaxFileSize: {$ClamavMaxFileSize}M\n";
    }
    $ClamUser = $unix->ClamUser();
    $ClamavTemporaryDirectory2 = dirname($ClamavTemporaryDirectory);
    $dirs[] = "/var/clamav";
    $dirs[] = "/var/run/clamav";
    $dirs[] = "/var/lib/clamav";
    $dirs[] = "/var/log/clamav";
    $dirs[] = $ClamavTemporaryDirectory;
    $dirs[] = "/var/spool/postfix/var/run/clamav";
    while (list($i, $directory) = each($dirs)) {
        @mkdir($directory, 0755, true);
        @chmod($directory, 0755);
        @chown($directory, $ClamUser);
        @chgrp($directory, $ClamUser);
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} Permissions on {$directory}\n";
        }
        $unix->chown_func($ClamUser, $ClamUser, $directory . "/*");
    }
    $f[] = "MilterSocket /var/spool/postfix/var/run/clamav/clamav-milter.ctl";
    $f[] = "MilterSocketGroup postfix";
    $f[] = "MilterSocketMode 777";
    $f[] = "FixStaleSocket yes";
    $f[] = "User postfix";
    $f[] = "AllowSupplementaryGroups yes";
    $f[] = "ReadTimeout 300";
    $f[] = "Foreground yes";
    $f[] = "PidFile /var/spool/postfix/var/run/clamav/clamav-milter.pid";
    $f[] = "TemporaryDirectory {$ClamavTemporaryDirectory}";
    $f[] = "ClamdSocket unix:/var/run/clamav/clamav.sock";
    $f[] = "";
    $f[] = "#LocalNet local";
    $f[] = "#LocalNet 192.168.0.0/24";
    $f[] = "#LocalNet 1111:2222:3333::/48";
    $f[] = "#Whitelist /etc/whitelisted_addresses";
    $f[] = "#SkipAuthenticated ^(tom|dick|henry)\$";
    $f[] = "MaxFileSize {$ClamavMaxFileSize}M";
    $f[] = "";
    $f[] = "";
    $f[] = "##";
    $f[] = "## Actions";
    $f[] = "##";
    $f[] = "";
    $f[] = "# The following group of options controls the delievery process under";
    $f[] = "# different circumstances.";
    $f[] = "# The following actions are available:";
    $f[] = "# - Accept";
    $f[] = "#   The message is accepted for delievery";
    $f[] = "# - Reject";
    $f[] = "#   Immediately refuse delievery (a 5xx error is returned to the peer)";
    $f[] = "# - Defer";
    $f[] = "#   Return a temporary failure message (4xx) to the peer";
    $f[] = "# - Blackhole (not available for OnFail)";
    $f[] = "#   Like Accept but the message is sent to oblivion";
    $f[] = "# - Quarantine (not available for OnFail)";
    $f[] = "#   Like Accept but message is quarantined instead of being delivered";
    $f[] = "#";
    $f[] = "# NOTE: In Sendmail the quarantine queue can be examined via mailq -qQ";
    $f[] = "# For Postfix this causes the message to be placed on hold";
    $f[] = "# ";
    $f[] = "# Action to be performed on clean messages (mostly useful for testing)";
    $f[] = "# Default: Accept";
    $f[] = "OnClean Accept";
    $f[] = "OnInfected Reject";
    $f[] = "OnFail Accept";
    $f[] = "RejectMsg rejected %v";
    $f[] = "AddHeader Add";
    $f[] = "#ReportHostname my.mail.server.name";
    $f[] = "#VirusAction /usr/local/bin/my_infected_message_handler";
    $f[] = "LogSyslog yes";
    $f[] = "LogFacility LOG_MAIL";
    $f[] = "LogVerbose no";
    $f[] = "#LogRotate yes";
    $f[] = "#LogInfected Basic";
    $f[] = "#LogClean Basic";
    $f[] = "#SupportMultipleRecipients yes";
    $f[] = "";
    @file_put_contents("/etc/clamav/clamav-milter.conf", @implode("\n", $f));
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} /etc/clamav/clamav-milter.conf done\n";
    }
    $main = new main_cf();
    $postfix_hash = $main->BuildMilters(true);
    $postconf = $unix->find_program("postconf");
    while (list($key, $value) = each($postfix_hash)) {
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} adding Postfix parameter: {$key} for {$value}\n";
        }
        shell_exec("{$postconf} -e \"{$key}={$value}\"");
    }
}
Esempio n. 11
0
function RelayHostDelete(){
	$main=new main_cf();
	unset($main->main_array["relayhost"]);
	$sock=new sockets();
	$sock->SET_INFO('PostfixRelayHost',null);
	$main->save_conf();
	$sock->getFrameWork("cmd.php?postfix-relayhost=yes");

}
Esempio n. 12
0
<?php

header("Pragma: no-cache");
header("Expires: 0");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-cache, must-revalidate");
include_once 'ressources/class.templates.inc';
include_once 'ressources/class.main_cf.inc';
if (count($_POST) == 0) {
    return null;
}
$main = new main_cf();
while (list($num, $val) = each($_POST)) {
    writelogs("receive from POST[{$num}]={$val}", __FUNCTION__, __FILE__);
    $main->main_array[$num] = $val;
}
$main->save_conf();
echo "Data saved";
?>


Esempio n. 13
0
function ApplyConfigPostfix()
{
    $users = new usersMenus();
    $users->LoadModulesEnabled();
    $tpl = new templates();
    if ($users->AsPostfixAdministrator == true) {
        //Apply amavis settings if installed
        if ($users->AMAVIS_INSTALLED == 1) {
            if ($users->EnableAmavisDaemon == 1) {
                include_once "ressources/class.amavis.inc";
                $amavis = new amavis();
                $amavis->Save();
                $amavis->SaveToServer();
            }
        }
        //------------------------------------
        $main = new main_cf();
        $main->save_conf();
        if (!$main->save_conf_to_server()) {
            $result = InfosError('postfix_main_settings', '{error}');
            echo $tpl->_ENGINE_parse_body($result);
            return null;
        }
        $filters = new main_header_check();
        $filters->SaveToDaemon();
        if ($users->KAV_MILTER_INSTALLED) {
            if ($users->KAVMILTER_ENABLED == 1) {
                include_once "ressources/class.kavmilterd.inc";
                $kavmilterd = new kavmilterd();
                $kavmilterd->ReBuildAllRules();
                $kavmilterd->SaveToLdap(0, 1);
                $tpl = new templates();
                echo $tpl->_ENGINE_parse_body(Success("aveserver_main_settings"));
            }
        }
        if ($users->AMAVIS_INSTALLED) {
            if ($users->EnableAmavisDaemon == 1) {
                include_once "ressources/class.amavis.inc";
                $amavis = new amavis();
                $amavis->Save();
            }
        }
        if ($users->kas_installed) {
            if ($users->KasxFilterEnabled == 1) {
                include_once "ressources/class.kas-filter.inc";
                $kas = new kas_single();
                $kas->Save();
            }
        }
        $result = Success("postfix_main_settings");
    } else {
        $result = NotAllowed("postfix_main_settings");
    }
    echo $tpl->_ENGINE_parse_body($result);
}
function smtpd_client_restrictions_save()
{
    $ldap = new clladp();
    if (!$ldap->ExistsDN("cn=restrictions_classes,cn=artica,{$ldap->suffix}")) {
        $upd["objectClass"][] = "top";
        $upd["objectClass"][] = "top";
        $upd["objectClass"][] = "PostFixStructuralClass";
        $upd["cn"][0] = "restrictions_classes";
        if (!$ldap->ldap_add("cn=restrictions_classes,cn=artica,{$ldap->suffix}", $upd)) {
            echo "cn=restrictions_classes,cn=artica,{$ldap->suffix}\n{$ldap->ldap_last_error}";
            return null;
        }
    }
    if ($ldap->ExistsDN("cn=smtpd_client_restrictions,cn=restrictions_classes,cn=artica,{$ldap->suffix}")) {
        $ldap->ldap_delete("cn=smtpd_client_restrictions,cn=restrictions_classes,cn=artica,{$ldap->suffix}", false);
        $upd1["objectClass"][] = "top";
        $upd1["objectClass"][] = "PostFixRestrictionStandardClasses";
        $upd1["cn"][0] = "smtpd_client_restrictions";
        if (!$ldap->ldap_add("cn=smtpd_client_restrictions,cn=restrictions_classes,cn=artica,{$ldap->suffix}", $upd1)) {
            echo "Modify smtpd_client_restrictions branch\n{$ldap->ldap_last_error}";
            return null;
        }
    }
    unset($upd1);
    if ($ldap->ExistsDN("cn=smtpd_helo_restrictions,cn=restrictions_classes,cn=artica,{$ldap->suffix}")) {
        $ldap->ldap_delete("cn=smtpd_helo_restrictions,cn=restrictions_classes,cn=artica,{$ldap->suffix}", false);
    }
    if (!$ldap->ExistsDN("cn=smtpd_helo_restrictions,cn=restrictions_classes,cn=artica,{$ldap->suffix}")) {
        $upd1["objectClass"][] = "top";
        $upd1["objectClass"][] = "PostFixRestrictionStandardClasses";
        $upd1["cn"][0] = "smtpd_helo_restrictions";
        if (!$ldap->ldap_add("cn=smtpd_helo_restrictions,cn=restrictions_classes,cn=artica,{$ldap->suffix}", $upd1)) {
            echo "Modify smtpd_helo_restrictions branch\n{$ldap->ldap_last_error}";
            return null;
        }
    }
    $EnablePostfixAntispamPack = $_GET["EnablePostfixAntispamPack"];
    $upd_vals["PostFixRestrictionClassList"][] = "permit_mynetworks=\"\"";
    $upd_vals["PostFixRestrictionClassList"][] = "permit_sasl_authenticated=\"\"";
    $upd_vals["PostFixRestrictionClassList"][] = "check_client_access=\"hash:/etc/postfix/postfix_allowed_connections\"";
    if ($_GET["reject_unknown_client_hostname"] == 1) {
        $upd_vals["PostFixRestrictionClassList"][] = "reject_unknown_client_hostname=\"\"";
    }
    if ($_GET["reject_invalid_hostname"] == 1) {
        $upd_vals["PostFixRestrictionClassList"][] = "reject_invalid_hostname=\"\"";
    }
    if ($_GET["reject_unknown_reverse_client_hostname"] == 1) {
        $upd_vals["PostFixRestrictionClassList"][] = "reject_unknown_reverse_client_hostname=\"\"";
    }
    if ($_GET["reject_unknown_sender_domain"] == 1) {
        $upd_vals["PostFixRestrictionClassList"][] = "reject_unknown_sender_domain=\"\"";
    }
    if ($_GET["reject_non_fqdn_sender"] == 1) {
        $upd_vals["PostFixRestrictionClassList"][] = "reject_non_fqdn_sender=\"\"";
    }
    if ($EnablePostfixAntispamPack == 1) {
        $upd_vals["PostFixRestrictionClassList"][] = "reject_rbl_client=\"zen.spamhaus.org\"";
        $upd_vals["PostFixRestrictionClassList"][] = "reject_rbl_client=\"sbl.spamhaus.org\"";
        $upd_vals["PostFixRestrictionClassList"][] = "reject_rbl_client=\"cbl.abuseat.org\"";
    }
    $upd_vals["PostFixRestrictionClassList"][] = "permit=\"\"";
    $sock = new sockets();
    $sock->SET_INFO('EnablePostfixAntispamPack', $EnablePostfixAntispamPack);
    $sock->SET_INFO('reject_forged_mails', $_GET["reject_forged_mails"]);
    if (!$ldap->Ldap_modify("cn=smtpd_client_restrictions,cn=restrictions_classes,cn=artica,{$ldap->suffix}", $upd_vals)) {
        echo "Modify smtpd_client_restrictions branch\n{$ldap->ldap_last_error}";
        return null;
    }
    unset($upd_vals);
    if ($EnablePostfixAntispamPack == 1) {
        $upd_vals["PostFixRestrictionClassList"][] = "permit_mynetworks=\"\"";
        $upd_vals["PostFixRestrictionClassList"][] = "permit_sasl_authenticated=\"\"";
        $upd_vals["PostFixRestrictionClassList"][] = "check_client_access=\"hash:/etc/postfix/postfix_allowed_connections\"";
        $upd_vals["PostFixRestrictionClassList"][] = "reject_non_fqdn_hostname=\"\"";
        $upd_vals["PostFixRestrictionClassList"][] = "reject_invalid_hostname=\"\"";
        $upd_vals["PostFixRestrictionClassList"][] = "permit=\"\"";
        if (!$ldap->Ldap_modify("cn=smtpd_helo_restrictions,cn=restrictions_classes,cn=artica,{$ldap->suffix}", $upd_vals)) {
            echo "Modify datas in smtpd_helo_restrictions branch\n{$ldap->ldap_last_error}";
            return null;
        }
    }
    $main = new main_cf();
    $main->save_conf_to_server(1);
    $sock = new sockets();
    $tpl = new templates();
    $sock->getFrameWork("cmd.php?reconfigure-postfix=yes");
}
Esempio n. 15
0
function bundle_save()
{
    $sock = new sockets();
    $name = $_GET["bundle_save"];
    $enable = $_GET["bundle_enable"];
    if ($name == "kasper") {
        if ($enable == "no") {
            writelogs("DISABLE KASPERSKY", __FUNCTION__, __FILE__);
            $artica = new artica_general();
            $artica->KasxFilterEnabled = 0;
            $artica->kavmilterEnable = 0;
            $artica->Save();
            $main = new main_cf();
            $main->save_conf();
            $main->save_conf_to_server();
        } else {
            $artica = new artica_general();
            $artica->KasxFilterEnabled = 1;
            $artica->kavmilterEnable = 1;
            $artica->Save();
            $main = new main_cf();
            $main->save_conf();
            $main->save_conf_to_server();
        }
        $tpl = new templates();
        echo $tpl->_ENGINE_parse_body("{enable}:{$enable} ->{success}\n");
        return null;
    }
    if ($name == "amavis") {
        if ($enable == "no") {
            writelogs("DISABLE AMAVIS", __FUNCTION__, __FILE__);
            $sock->SET_INFO("EnableAmavisDaemon", "0");
            $main = new main_cf();
            $main->save_conf();
            $main->save_conf_to_server();
        } else {
            $sock = new sockets();
            $sock->SET_INFO("EnableAmavisDaemon", "1");
            $main = new main_cf();
            $main->save_conf();
            $main->save_conf_to_server();
        }
        $tpl = new templates();
        echo $tpl->_ENGINE_parse_body("{enable}:{$enable} ->{success}\n");
        return null;
    }
    if ($name == "addons") {
        if ($enable == "no") {
            writelogs("DISABLE ADDONS", __FUNCTION__, __FILE__);
            $artica = new artica_general();
            $artica->MilterGreyListEnabled = 0;
            $artica->Save();
            $main = new main_cf();
            $main->save_conf();
            $main->save_conf_to_server();
        } else {
            $artica = new artica_general();
            $artica->MilterGreyListEnabled = 1;
            $artica->Save();
            $main = new main_cf();
            $main->save_conf();
            $main->save_conf_to_server();
        }
        $tpl = new templates();
        echo $tpl->_ENGINE_parse_body("{enable}:{$enable} ->{success}\n");
        return null;
    }
    if ($name == "opensource") {
        $sock = new sockets();
        if ($enable == "no") {
            writelogs("DISABLE opensource", __FUNCTION__, __FILE__);
            $artica = new artica_general();
            $artica->SpamAssMilterEnabled = 0;
            $artica->ClamavMilterEnabled = 0;
            $artica->Save();
            $main = new main_cf();
            $main->save_conf();
            $main->save_conf_to_server();
        } else {
            $artica = new artica_general();
            $sock->SET_INFO("EnableAmavisDaemon", 0);
            $artica->SpamAssMilterEnabled = 1;
            $artica->ClamavMilterEnabled = 1;
            $artica->Save();
            $main = new main_cf();
            $main->save_conf();
            $main->save_conf_to_server();
        }
        $tpl = new templates();
        echo $tpl->_ENGINE_parse_body("{enable}:{$enable} ->{success}\n");
        return null;
    }
}
Esempio n. 16
0
<?php
if(posix_getuid()<>0){die("Cannot be used in web server mode\n\n");}
include_once(dirname(__FILE__).'/ressources/class.templates.inc');
include_once(dirname(__FILE__).'/ressources/class.ini.inc');
include_once(dirname(__FILE__).'/ressources/class.main_cf.inc');
include_once(dirname(__FILE__).'/ressources/class.amavis.inc');
include_once(dirname(__FILE__).'/ressources/class.samba.inc');
include_once(dirname(__FILE__).'/ressources/class.squid.inc');

$main=new main_cf();
$main->save_conf();
$main->save_conf_to_server(1);

$amavis=new amavis();
$amavis->Save();
$amavis->SaveToServer();

$samba=new samba();
$samba->SaveToLdap();

$squid=new squidbee();
$squid->SaveToLdap();
$squid->SaveToServer();

system('/etc/init.d/artica-postfix restart postfix');
system('/etc/init.d/artica-postfix restart squid');
system('/etc/init.d/artica-postfix restart samba');
system('/usr/share/artica-postfix/bin/artica-install --cyrus-checkconfig');
system('/etc/init.d/artica-postfix restart imap');
system('/etc/init.d/artica-postfix restart saslauthd');
function COMPILE()
{
    $sock = new sockets();
    $sock->SET_INFO("KasxFilterEnabled", 1);
    $sock->SET_INFO("kavmilterEnable", 1);
    $domain = trim(strtolower($_SESSION["WIZARD"]["ORGANIZATION"]));
    $ou = $_SESSION["WIZARD"]["ORGANIZATION"];
    $ou = str_replace(" ", "_", $ou);
    $ldap = new clladp();
    $ldap->AddOrganization($_SESSION["WIZARD"]["ORGANIZATION"]);
    $hashdoms = $ldap->hash_get_all_domains();
    if ($hashdoms[$domain] == null) {
        $ldap->AddRelayDomain($ou, $domain, $_SESSION["WIZARD"]["MAILBOX_IP"], 25);
    }
    $kas = new kas_mysql($ou);
    $kas->SET_VALUE("OPT_FILTRATION_ON", 1);
    $main = new main_cf();
    $main->add_my_networks($_SESSION["WIZARD"]["SMTP_NET"]);
    $main->save_conf_to_server();
    $sock->getFrameWork("cmd.php?kas-reconfigure=yes");
    $sock->getFrameWork("cmd.php?kavmilter-configure");
    $tpl = new templates();
    $html = "\n\t\t\n\t\t<H3>{success}</H3><center>" . button("{close}", "CloseTimeOut()") . "</center>";
    echo $tpl->_ENGINE_parse_body("{success}");
}
Esempio n. 18
0
function SaveISPAddress()
{
    $tpl = new templates();
    $domain = new DomainsTools();
    $page = CurrentPageName();
    $address = $domain->transport_maps_implode($_GET["isp_address"], $_GET["isp_port"]);
    $sasl = new smtp_sasl_password_maps();
    writepostfixlogs("Set ISP server has {$address}", __FUNCTION__, __FILE__);
    $sock = new sockets();
    $sock->SET_INFO("PostfixRelayHost", "{$address}");
    writepostfixlogs("is this server {$address} must use authentication ?", __FUNCTION__, __FILE__);
    if (trim($_GET["isp_username"]) == null) {
        $sasl->delete($address);
        exit;
    }
    if (trim($_GET["isp_password"]) == null) {
        die("password NULL !");
    }
    writepostfixlogs("Enable SMTP Sasl", __FUNCTION__, __FILE__);
    $main = new main_cf();
    $main->smtp_sasl_password_maps_enable();
    if (!$sasl->add($address, trim($_GET["isp_username"]), trim($_GET["isp_password"]))) {
        die($sasl->ldap_infos);
    }
}
Esempio n. 19
0
function main_fetchmail_build(){
	include_once('ressources/class.user.inc');
	include_once('ressources/class.main_cf.inc');
	include_once('ressources/class.fetchmail.inc');
	
	
$failed=false;	
	
$isp_address_mail=$_GET["isp_address_mail"];
$isp_pop3_server=$_GET["isp_pop3_server"];
$isp_smtp_server=$_GET["isp_smtp_server"];
	
$isp_account=$_GET["isp_account"];
$isp_password=$_GET["isp_password"];
$local_email=$_GET["local_email"];
$local_password=$_GET["local_password"];
	
$isp_smtp_account=$_GET["isp_smtp_account"];
$isp_smtp_password=$_GET["isp_smtp_password"];
	
$relay_server=$_GET["relay_server"];


if($local_email==null){
	echo main_fetchmail_build_results(true,'local mail (False)');
	exit;
}

$ldap=new clladp();
writelogs("i try to found if user exists",__FUNCTION__,__FILE__);
$uid=$ldap->uid_from_email($local_email);
if($uid<>null){
	$user=new user($local_email);
	$ou=$user->ou;
}else{
	writelogs("no user found, create it",__FUNCTION__,__FILE__);
	$tb=explode("@",$local_email);
	$local_domain=$tb[1];  
	$user=new user($tb[0]);
	$ou=$ldap->ou_by_smtp_domain($local_domain);
	if($ou==null){
		$ou=$local_domain;
		writelogs("Adding new organization $ou",__FUNCTION__,__FILE__);
		$ldap->AddOrganization($ou);
	}	
	
}


	
	writelogs("Creating user",__FUNCTION__,__FILE__);
	$user=new user($local_email);
	$user->mail=$local_email;
	$user->password=$local_password;
	$user->ou=$ou;
	$user->SenderCanonical=$isp_address_mail;
	if(!$user->add_user()){
		echo main_fetchmail_build_results(true,$user->ldap_error);
		exit;
	}
	
	
	if($isp_smtp_account<>null){
		writelogs("Creating SMTP authentification for $isp_smtp_server width $isp_smtp_account",__FUNCTION__,__FILE__);
		$sasl=new smtp_sasl_password_maps();
		$sasl->add($isp_address_mail,$isp_smtp_account,$isp_password);
		$main=new main_cf();
		writelogs("Enable sasl engine in postfix",__FUNCTION__,__FILE__);
		$main->smtp_sasl_password_maps_enable_2();		
		
	}
	writelogs("Creating sender_dependent_relayhost_maps -> $isp_smtp_server",__FUNCTION__,__FILE__);
	$sender=new sender_dependent_relayhost_maps();
	if(!$sender->Add($isp_address_mail,$isp_smtp_server)){
		echo main_fetchmail_build_results(true,"sender_dependent_relayhost_maps:$sender->ldap_error");
		exit;
	}
	

	$fetchmail=new Fetchmail_settings();
	$array["poll"]=$isp_pop3_server;
	$array["proto"]="auto";
	$array["keep"]="yes";
	$array["user"]=$isp_account;
	$array["pass"]=$isp_password;
	$array["is"]=$local_email;
	$array["fetchall"]="yes";
	$line=$fetchmail->compile($array);
	if(!$user->fetchmail_add_rule($line)){
		echo main_fetchmail_build_results(true,"fetchmail rule:$user->ldap_error");
		exit;
	}
	
	$relay=new Routing($ou);
	if($relay_server<>null){
		if(!$relay->create_relay_server($local_domain,$relay_server,$ou)){
				echo main_fetchmail_build_results(true,"relay:$relay->ldap_error");
			}
		}else{
			if(!$relay->create_localdomain($ou,$local_domain)){
				echo main_fetchmail_build_results(true,"local domain:$relay->ldap_error");
			}
		}

	
	$fetchmail=new fetchmail();
	$fetchmail->Save();
	$main=new main_cf();
	$main->save_conf();
	$main->save_conf_to_server();
	
	
	
	$info="<table style='width:100%'>
	<tr>
		<td width=1%><img src='img/fw_bold.gif'></td>
		<td nowrap align='right'><strong>{organization}</strong>:</td>
		<td nowrap><strong>$ou</strong></td>
	</tr>
	<tr>
		<td width=1%><img src='img/fw_bold.gif'></td>
		<td nowrap align='right'><strong>{local_mail}</strong>:</td>
		<td nowrap><strong>$local_email</strong></td>
	</tr>
	<tr>
		<td width=1%><img src='img/fw_bold.gif'></td>
		<td nowrap align='right'><strong>{isp_address_mail}</strong>:</td>
		<td nowrap><strong>$isp_address_mail</strong></td>
	</tr>			
	</table>	
	";
	
	echo main_fetchmail_build_results(false,$info);
	
	
}
Esempio n. 20
0
function ActiveTLSMsgbox_SavePostfix()
{
    $main = new main_cf();
    $main->save_conf();
    $main->save_conf_to_server();
    $html = "<table style='width:100%'>\n\t<tr>\n\t<td width=1% valign='top'><img src='img/ok24.png'></td>\n\t<td><strong>{restarting_postfix}</strong><p class=caption>{you_can_close}</p></td>\n\t</tr>\n\t</table>\n\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
function PostfixAddFallBackServerMove()
{
    $main = new main_cf();
    $hash = explode(',', $main->main_array["smtp_fallback_relay"]);
    $newarray = array_move_element($hash, $hash[$_GET["PostfixAddFallBackServerMove"]], $_GET["move"]);
    $main->main_array["smtp_fallback_relay"] = implode(",", $newarray);
    $main->save_conf();
}
function smtpd_client_restrictions_save()
{
    $ou = $_GET["ou"];
    unset($_GET["ou"]);
    while (list($key, $line) = each($_GET)) {
        $array[$key] = $line;
    }
    $ayrre = base64_encode(serialize($array));
    $q = new mysql();
    $sql = "SELECT ID FROM postfix_multi WHERE `key`='smtpd_client_restrictions' AND `ou`='{$ou}'";
    $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
    if ($ligne["ID"] < 1) {
        $sql = "INSERT INTO postfix_multi  (`ou`,`key`,`ValueTEXT`) VALUES('{$ou}','smtpd_client_restrictions','{$ayrre}')";
    } else {
        $sql = "UPDATE postfix_multi SET `ValueTEXT`='{$ayrre}' WHERE ID={$ligne["ID"]}";
    }
    $q->QUERY_SQL($sql, "artica_backup");
    if (!$q->ok) {
        echo $q->mysql_error;
        return;
    }
    $sock = new sockets();
    $sock->getFrameWork("cmd.php?postfix-multi-configure-ou={$ou}");
    return;
    $upd_vals["PostFixRestrictionClassList"][] = "permit_mynetworks=\"\"";
    $upd_vals["PostFixRestrictionClassList"][] = "permit_sasl_authenticated=\"\"";
    $upd_vals["PostFixRestrictionClassList"][] = "check_client_access=\"hash:/etc/postfix/postfix_allowed_connections\"";
    if ($_GET["reject_unknown_client_hostname"] == 1) {
        $upd_vals["PostFixRestrictionClassList"][] = "reject_unknown_client_hostname=\"\"";
    }
    if ($_GET["reject_invalid_hostname"] == 1) {
        $upd_vals["PostFixRestrictionClassList"][] = "reject_invalid_hostname=\"\"";
    }
    if ($_GET["reject_unknown_reverse_client_hostname"] == 1) {
        $upd_vals["PostFixRestrictionClassList"][] = "reject_unknown_reverse_client_hostname=\"\"";
    }
    if ($_GET["reject_unknown_sender_domain"] == 1) {
        $upd_vals["PostFixRestrictionClassList"][] = "reject_unknown_sender_domain=\"\"";
    }
    if ($_GET["reject_non_fqdn_sender"] == 1) {
        $upd_vals["PostFixRestrictionClassList"][] = "reject_non_fqdn_sender=\"\"";
    }
    if ($EnablePostfixAntispamPack == 1) {
        $upd_vals["PostFixRestrictionClassList"][] = "reject_rbl_client=\"zen.spamhaus.org\"";
        $upd_vals["PostFixRestrictionClassList"][] = "reject_rbl_client=\"sbl.spamhaus.org\"";
        $upd_vals["PostFixRestrictionClassList"][] = "reject_rbl_client=\"cbl.abuseat.org\"";
        /*reject_rbl_client bl.spamcop.net,
                reject_rbl_client b.barracudacentral.org,
                reject_rbl_client zen.spamhaus.org,
                reject_rbl_client dul.dnsbl.sorbs.net,
                reject_rbl_client psbl.surriel.com,
                reject_rbl_client ix.dnsbl.manitu.net, 
        		*/
    }
    $upd_vals["PostFixRestrictionClassList"][] = "permit=\"\"";
    $sock = new sockets();
    $sock->SET_INFO('EnablePostfixAntispamPack', $EnablePostfixAntispamPack);
    if (!$ldap->Ldap_modify("cn=smtpd_client_restrictions,cn=restrictions_classes,cn=artica,{$ldap->suffix}", $upd_vals)) {
        echo "Modify smtpd_client_restrictions branch\n{$ldap->ldap_last_error}";
        return null;
    }
    unset($upd_vals);
    if ($EnablePostfixAntispamPack == 1) {
        $upd_vals["PostFixRestrictionClassList"][] = "permit_mynetworks=\"\"";
        $upd_vals["PostFixRestrictionClassList"][] = "permit_sasl_authenticated=\"\"";
        $upd_vals["PostFixRestrictionClassList"][] = "check_client_access=\"hash:/etc/postfix/postfix_allowed_connections\"";
        $upd_vals["PostFixRestrictionClassList"][] = "reject_non_fqdn_hostname=\"\"";
        $upd_vals["PostFixRestrictionClassList"][] = "reject_invalid_hostname=\"\"";
        $upd_vals["PostFixRestrictionClassList"][] = "permit=\"\"";
        if (!$ldap->Ldap_modify("cn=smtpd_helo_restrictions,cn=restrictions_classes,cn=artica,{$ldap->suffix}", $upd_vals)) {
            echo "Modify datas in smtpd_helo_restrictions branch\n{$ldap->ldap_last_error}";
            return null;
        }
    }
    $main = new main_cf();
    $main->save_conf_to_server(1);
    $sock = new sockets();
    $tpl = new templates();
    $datas = $sock->getfile("PostfixReload");
    if (trim($datas == null)) {
        for ($i = 0; $i < 10; $i++) {
            sleep(1);
            $datas = trim($sock->getfile("PostfixReload")) . " ({$i})";
            break;
        }
    }
    echo $tpl->_ENGINE_parse_body("\n{smtpd_client_restrictions} {success} \"{$datas}\"\n");
}
function ajax_pop()
{
    $sock = new sockets();
    $users = new usersMenus();
    $users->LoadModulesEnabled();
    $EnableAmavisDaemon = $users->EnableAmavisDaemon;
    if (!$users->AMAVIS_INSTALLED) {
        $EnableAmavisDaemon = 0;
    }
    if (!is_numeric($EnableAmavisDaemon)) {
        $EnableAmavisDaemon = 0;
    }
    $EnableArticaPolicyFilter = $sock->GET_INFO("EnableArticaPolicyFilter");
    $EnableArticaPolicyFilter = 0;
    if (!is_numeric($EnableArticaPolicyFilter)) {
        $EnableArticaPolicyFilter = 0;
    }
    $ArticaPolicyFilterMaxRCPTInternalDomainsOnly = $sock->GET_INFO("ArticaPolicyFilterMaxRCPTInternalDomainsOnly");
    $SpamassassinMaxRCPTScore = $sock->GET_INFO("SpamassassinMaxRCPTScore");
    $page = CurrentPageName();
    $main = new main_cf();
    $main->FillDefaults();
    $message_size_limit = $sock->GET_INFO("message_size_limit");
    $main->main_array["default_destination_recipient_limit"] = $sock->GET_INFO("default_destination_recipient_limit");
    $main->main_array["smtpd_recipient_limit"] = $sock->GET_INFO("smtpd_recipient_limit");
    $main->main_array["mime_nesting_limit"] = $sock->GET_INFO("mime_nesting_limit");
    $PostfixNotifyMessagesRestrictions = $sock->GET_INFO("PostfixNotifyMessagesRestrictions");
    $main = new maincf_multi("master", "master");
    $header_address_token_limit = $sock->GET_INFO("header_address_token_limit");
    $header_size_limit = $sock->GET_INFO("header_size_limit");
    $max_rcpt_to = $main->GET("max_rcpt_to");
    if (!is_numeric($message_size_limit)) {
        $message_size_limit = 10240000;
    }
    $main->main_array["virtual_mailbox_limit"] = $sock->GET_INFO("virtual_mailbox_limit");
    $message_size_limit = $message_size_limit / 1024 / 1000;
    $main->main_array["virtual_mailbox_limit"] = $main->main_array["virtual_mailbox_limit"] / 1024 / 1000;
    if (!is_numeric($header_address_token_limit)) {
        $header_address_token_limit = 10240;
    }
    if (!is_numeric($header_size_limit)) {
        $header_size_limit = 102400;
    }
    if (!is_numeric($max_rcpt_to)) {
        $max_rcpt_to = 0;
    }
    if (!is_numeric($PostfixNotifyMessagesRestrictions)) {
        $PostfixNotifyMessagesRestrictions = 0;
    }
    $header_size_limit = $header_size_limit / 1024;
    if (!is_numeric($SpamassassinMaxRCPTScore)) {
        $SpamassassinMaxRCPTScore = 10;
    }
    $html = "\n\t\t\n\t\t<div id='messages_restriction_id'>\n\t\t\n\t\t\n\n\t\n\n\n\t\t<div style='font-size:16px'><strong>{max_rcpt_to}</strong></div>\n\t\t<table class=form style='width:99%'>\n\t\t<tr>\n\t\t\t<td nowrap class=legend style='font-size:13px'>{max_rcpt_to}</strong>:</td>\n\t\t\t<td style='font-size:13px'>" . Field_text('max_rcpt_to', $max_rcpt_to, 'width:60px;font-size:13px;padding:3px;text-align:right') . "&nbsp;{recipients} </td>\n\t\t\t<td>" . help_icon('{max_rcpt_to_text}') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td nowrap class=legend style='font-size:13px'>{max_rcpt_to_onlyForLocalDomains}</strong>:</td>\n\t\t\t<td style='font-size:13px'>" . Field_checkbox("ArticaPolicyFilterMaxRCPTInternalDomainsOnly", 1, $ArticaPolicyFilterMaxRCPTInternalDomainsOnly, "ArticaPolicyFilterMaxRCPTInternalDomainsOnlySave()") . "</td>\n\t\t\t<td>" . help_icon('{max_rcpt_to_onlyForLocalDomains_text}') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td nowrap class=legend style='font-size:13px'>{score}</strong>:</td>\n\t\t\t<td style='font-size:13px'>" . Field_text('SpamassassinMaxRCPTScore', $SpamassassinMaxRCPTScore, 'width:40px;font-size:13px;padding:3px;text-align:right') . "</td>\n\t\t\t<td>" . help_icon('{SpamassassinMaxRCPTScore_text}') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td colspan=3 align='rigth' style='padding-right:10px;text-align:right'>\n\t\t\t" . button("{apply}", "SaveMessagesRestrictions()") . "</td>\n\t\t</tr>\n\t\t</table>\t\t\t\t\t\t\t\t\t\n\t\t\n\t\t<div style='font-size:16px'><strong>{restrictions}</strong></div>\n\t\t<table class=form style='width:99%'>\n\n\t\t\n\t\t<tr>\n\t\t\t<td nowrap class=legend style='font-size:13px'>{message_size_limit}</strong>:</td>\n\t\t\t<td style='font-size:13px'>" . Field_text('message_size_limit', $message_size_limit, 'width:60px;font-size:13px;padding:3px;text-align:right') . "&nbsp;MB</td>\n\t\t\t<td>" . help_icon('{message_size_limit_text}') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td nowrap class=legend style='font-size:13px'>{virtual_mailbox_limit}</strong>:</td>\n\t\t\t<td style='font-size:13px'>" . Field_text('virtual_mailbox_limit', $main->main_array["virtual_mailbox_limit"], 'width:60px;font-size:13px;padding:3px;text-align:right') . "&nbsp;MB </td>\n\t\t\t<td>" . help_icon('{virtual_mailbox_limit_text}') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td nowrap class=legend style='font-size:13px'>{mime_nesting_limit}</strong>:</td>\n\t\t\t<td>" . Field_text('mime_nesting_limit', $main->main_array["mime_nesting_limit"], 'width:60px;font-size:13px;padding:3px;text-align:right') . " </td>\n\t\t\t<td>" . help_icon('{mime_nesting_limit_text}') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td nowrap class=legend style='font-size:13px'>{header_address_token_limit_field}</strong>:</td>\n\t\t\t<td>" . Field_text('header_address_token_limit', $header_address_token_limit, 'width:60px;font-size:13px;padding:3px;text-align:right') . " </td>\n\t\t\t<td>" . help_icon('{header_address_token_limit_explain}') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td nowrap class=legend style='font-size:13px'>{header_size_limit}:</td>\n\t\t\t<td style='font-size:13px'>" . Field_text('header_size_limit', $header_size_limit, 'width:60px;font-size:13px;padding:3px;text-align:right') . "&nbsp;KB </td>\n\t\t\t<td>" . help_icon('{header_size_limit_text}') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td nowrap class=legend style='font-size:13px'>{notify}:</td>\n\t\t\t<td style='font-size:13px'>" . Field_checkbox("PostfixNotifyMessagesRestrictions", 1, $PostfixNotifyMessagesRestrictions, "PostfixNotifyMessagesRestrictionsSave()") . "</td>\n\t\t\t<td>" . help_icon('{PostfixNotifyMessagesRestrictions_text}') . "</td>\n\t\t</tr>\n\t<tr>\n\t<td colspan=3 align='rigth' style='padding-right:10px;text-align:right'>\n\t\t" . button("{apply}", "SaveMessagesRestrictions()") . "</td>\n\t</tr>\t\t\n\t\t</table>\n\t\t\n\t\t\n\t<div style='font-size:16px'><strong>{performances}</strong></div>\n\t<table class=form style='width:99%'>\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:13px'>{default_destination_recipient_limit}</strong>:</td>\n\t\t<td>" . Field_text('default_destination_recipient_limit', $main->main_array["default_destination_recipient_limit"], 'width:60px;font-size:13px;padding:3px;text-align:right') . "</td>\n\t\t<td>" . help_icon('{default_destination_recipient_limit_text}') . "</td>\n\t</tr>\n\t\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:13px'>{smtpd_recipient_limit}</strong>:</td>\n\t\t<td>" . Field_text('smtpd_recipient_limit', $main->main_array["smtpd_recipient_limit"], 'width:60px;font-size:13px;padding:3px;text-align:right') . "</td>\n\t\t<td>" . help_icon('{smtpd_recipient_limit_text}') . "</td>\n\t</tr>\n\n\n\n\t<tr>\n\t<td colspan=3 align='rigth' style='padding-right:10px;text-align:right'>\n\t\t" . button("{apply}", "SaveMessagesRestrictions()") . "</td>\n\t</tr>\n\t</table>\n\t</div>\n\t<script>\nvar x_SaveMessagesRestrictions=function (obj) {\n\ttempvalue=obj.responseText;\n\tYahooWinSHide();\n    }\t\n\t\nfunction SaveMessagesRestrictions(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('header_size_limit',document.getElementById('header_size_limit').value);\n\tXHR.appendData('message_size_limit',document.getElementById('message_size_limit').value);\n\tXHR.appendData('default_destination_recipient_limit',document.getElementById('default_destination_recipient_limit').value);\n\tXHR.appendData('smtpd_recipient_limit',document.getElementById('smtpd_recipient_limit').value);\n\tXHR.appendData('mime_nesting_limit',document.getElementById('mime_nesting_limit').value);\n\tXHR.appendData('header_address_token_limit',document.getElementById('header_address_token_limit').value);\n\tXHR.appendData('virtual_mailbox_limit',document.getElementById('virtual_mailbox_limit').value);\n\tXHR.appendData('max_rcpt_to',document.getElementById('max_rcpt_to').value);\n\tXHR.appendData('SpamassassinMaxRCPTScore',document.getElementById('SpamassassinMaxRCPTScore').value);\n\t\n\t\n\t\n\tdocument.getElementById('messages_restriction_id').innerHTML='<center><img src=\"img/wait_verybig.gif\"></center>';\n\tXHR.sendAndLoad('{$page}', 'GET',x_SaveMessagesRestrictions);\n}\t\n\nfunction PostfixNotifyMessagesRestrictionsSave(){\n\tvar XHR = new XHRConnection();\n\tif(document.getElementById('PostfixNotifyMessagesRestrictions').checked){\n\t\tXHR.appendData('PostfixNotifyMessagesRestrictions',1);\n\t}else{\n\t\tXHR.appendData('PostfixNotifyMessagesRestrictions',0);\n\t}\n\tXHR.sendAndLoad('{$page}', 'GET');\n}\n\nfunction ArticaPolicyFilterMaxRCPTInternalDomainsOnlySave(){\n\tvar XHR = new XHRConnection();\n\tif(document.getElementById('ArticaPolicyFilterMaxRCPTInternalDomainsOnly').checked){\n\t\tXHR.appendData('ArticaPolicyFilterMaxRCPTInternalDomainsOnly',1);\n\t}else{\n\t\tXHR.appendData('ArticaPolicyFilterMaxRCPTInternalDomainsOnly',0);\n\t}\n\tXHR.sendAndLoad('{$page}', 'GET');\n}\n\n\nfunction CheckRequiredRestrictionsFields(){\n\tvar EnableArticaPolicyFilter={$EnableAmavisDaemon};\n\tif(EnableArticaPolicyFilter==0){\n\t\tdocument.getElementById('ArticaPolicyFilterMaxRCPTInternalDomainsOnly').disabled=true;\n\t\tdocument.getElementById('SpamassassinMaxRCPTScore').disabled=true;\n\t}\n}\n\n\nCheckRequiredRestrictionsFields();\n</script>\n\t\n\t\n\t";
    $tpl = new templates();
    echo $tpl->_parse_body($html);
}
Esempio n. 24
0
function relayhost_save(){
	$main=new main_cf();
	$tpl=new templates();
	$stunnel=new stunnel4();
	$continue=true;
	$main->smtp_sasl_password_maps_enable_2();
	$localport=$stunnel->main_array["postfix_relayhost"]["accept"];
	
	writelogs("Saving [127.0.0.1]:$localport -> {$_GET["username"]}",__FUNCTION__,__FILE__,__LINE__);
	
	$main->main_array["relayhost"]="[127.0.0.1]:$localport";
	$main->save_conf();
	
	$sock=new sockets();
	$sock->SET_INFO("PostfixRelayHost","[127.0.0.1]:$localport");	
	$sock->getFrameWork("cmd.php?postfix-relayhost=yes");
	
	if($_GET["username"]==null){$continue=false;}
	if($_GET["password"]==null){$continue=false;}
		$saslpswd=new smtp_sasl_password_maps();
		if($continue){
			writelogs("UPDATE [127.0.0.1]:$localport",__FUNCTION__,__FILE__,__LINE__);
			if(!$saslpswd->add("[127.0.0.1]:$localport",$_GET["username"],$_GET["password"])){
				echo $tpl->javascript_parse_text("{err_sasl_saveldap}<br>$saslpswd->ldap_infos");
				return;
			}
			
			$sock->SET_INFO("smtp_sender_dependent_authentication",1);
			$sock->getFrameWork("cmd.php?postfix-hash-senderdependent=yes");
			$sock->getFrameWork("cmd.php?postfix-smtp-sasl=yes");
		}else{
			writelogs("Delete [127.0.0.1]:$localport",__FUNCTION__,__FILE__,__LINE__);
			$saslpswd->delete("[127.0.0.1]:$localport");
		}
	
}
Esempio n. 25
0
function PostFixCheckHashTableSelectPrependAction()
{
    $main = new main_cf();
    $h = $main->HashGetHeadersList();
    $h[null] = '{select}';
    $field_headers = Field_array_Hash($h, 'headers', null, null, null, 0, 'width:100%');
    $html = "\n\t<div style='padding:20px'>\n\t\t<div class='caption'>{PREPEND_help}</div>\n\t\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td align='right'><strong>{select}:</strong>\n\t\t\t<td>{$field_headers}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td align='right'><strong>{prepend_text}:</strong>\n\t\t\t<td>" . Field_text('prepend_text', null, 'width:100%') . "</td>\n\t\t</tr>\t\t\n\t\t</table>\n\t\t<div id='FilterTableSelected'></div>\n\t\t<div style='text-align:right'><input type='button' value='{apply}&nbsp;&raquo;' onClick=\"javascript:PostFixCheckHashTableSelectPrependActionSave()\"></div>\n\t</div>";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 26
0
function check_sender_access()
{
    $tpl = new templates();
    $main = new main_cf();
    $u = $main->check_sender_access();
    if ($u > 0) {
        echo $tpl->_ENGINE_parse_body("\n{ENABLE_INTERNET_DENY} {success} {$u} {users} {enabled}", "postfix.index.php");
    }
}
Esempio n. 27
0
function SaveSettings()
{
    echo "<div><code>";
    $ldap = new clladp();
    $usersMenus = new usersMenus();
    $ldap->AddOrganization($_COOKIE["company"]);
    echo "</div></code>";
    echo "<div><code>";
    if (!$usersMenus->cyrus_imapd_installed) {
        $ldap->AddRelayDomain($_COOKIE["company"], $_COOKIE["smtp_domain"], $_COOKIE["smtp_relay"], 25);
    } else {
        $ldap->AddDomainEntity($_COOKIE["company"], $_COOKIE["smtp_domain"]);
    }
    echo "</div></code>";
    echo "<div><code>";
    $users = new user($_COOKIE["username"]);
    $users->mail = "{$_COOKIE["username"]}@{$_COOKIE["smtp_domain"]}";
    $users->password = $_COOKIE["password"];
    $users->ou = $_COOKIE["company"];
    $users->add_user();
    $users->add_alias("root");
    $users->add_alias("mailflt3");
    $users->add_alias("*****@*****.**");
    $users->add_alias("root@{$usersMenus->fqdn}");
    $users->add_alias("postmaster@{$usersMenus->fqdn}");
    $users->add_alias("*****@*****.**");
    $users->add_alias("postmaster");
    echo "</div></code>";
    $sock = new sockets();
    $sock->SET_INFO("PostmasterAdress", $users->mail);
    $sock->SET_INFO("MasterSMTPDomainName", $_COOKIE["smtp_domain"]);
    $sock->SET_INFO("SmtpWizardFinish", 1);
    if ($usersMenus->AMAVIS_INSTALLED) {
        echo "<div><code>";
        include_once "ressources/class.amavis.inc";
        $amavis = new amavis();
        $amavis->Save();
        $sock->SET_INFO("EnableAmavisDaemon", "1");
        $sock->getFrameWork("cmd.php?artica-filter-reload=yes");
        $amavis->SaveToServer();
        echo "</div></code>";
    }
    if ($usersMenus->BIND9_INSTALLED) {
        include_once "ressources/class.bind9.inc";
        include_once "ressources/class.system.network.inc";
        $net = new networking();
        if (is_array($net->arrayNameServers)) {
            $dns = implode("\n", $net->arrayNameServers);
            $sock->SaveConfigFile($dns, "PostfixBind9DNSList");
            $sock->SET_INFO('PostfixEnabledInBind9', 1);
        }
    }
    echo "<div><code>";
    $main = new main_cf();
    $main->save_conf();
    $main->save_conf_to_server();
    echo "</div></code>";
}
Esempio n. 28
0
function Delete_Intet_Interface()
{
    $main = new main_cf();
    unset($main->array_inet_interfaces[$_GET["Delete_Intet_Interface"]]);
    $main->save_conf();
    echo MyInet_interfaces();
}
Esempio n. 29
0
function SaveDNSSettings(){
	$main=new main_cf();	
	$main->main_array["ignore_mx_lookup_error"]=$_GET["ignore_mx_lookup_error"];
	$main->main_array["disable_dns_lookups"]=$_GET["disable_dns_lookups"];
	$main->main_array["myhostname"]=$_GET["myhostname"];
	$main->save_conf();
	
	$sock=new sockets();
	$sock->SET_INFO("myhostname",$_GET["myhostname"]);
	$sock->getFrameWork("cmd.php?postfix-others-values=yes");
	
	
	}
Esempio n. 30
0
function apply_popup2()
{
    $amavis = new amavis();
    $amavis->Save();
    $amavis->SaveToServer();
    $main = new main_cf();
    $main->save_conf();
    $main->save_conf_to_server();
}