Esempio n. 1
0
function popup()
{
    $ou = base64_decode($_GET["ou"]);
    $page = CurrentPageName();
    if ($_GET["hostname"] == "master") {
        $ipstr = "127.0.0.1";
    }
    $main = new maincf_multi($_GET["hostname"], $ou, $ipstr);
    $dkimproxyEnabled = $main->GET("dkimproxyEnabled");
    $freeport = $main->GET("dkimproxy_listenport");
    if ($freeport == null) {
        $freeport = findFreePort();
        $main->SET_VALUE("dkimproxy_listenport", $freeport);
    }
    $method_arr = array("simple" => "simple", "relaxed" => "relaxed", "relaxed/relaxed" => "relaxed/relaxed");
    $tpl = new templates();
    $explian = $tpl->_ENGINE_parse_body("{dkimproxy_selector_text}");
    $array = unserialize(base64_decode($main->GET_BIGDATA("dkimproxy_datas")));
    if ($array["selector_name"] == null) {
        $array["selector_name"] = "selector1";
    }
    if ($array["method"] == null) {
        $array["method"] = "simple";
    }
    $method = Field_array_Hash($method_arr, "method", $array["method"], null, null, 0, "font-size:13px;padding:3px");
    $explian = str_replace("--selector--", $array["selector_name"], $explian);
    $html = "\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td class=legend style='font-size:13px'>{enable_dkimproxyout}:</td>\n\t\t<td>" . Field_checkbox("dkimproxyEnabled", 1, $dkimproxyEnabled, "CheckdkimproxyEnabled()") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:13px'>{selector_name}:</td>\n\t\t<td>" . Field_text("selector_name", $array["selector_name"], "font-size:13px;padding:3px;width:100px") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:13px'>{dkimproxy_method}:</td>\n\t\t<td>{$method}</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:13px'>{listen_port}:</td>\n\t\t<td>" . Field_text("listen_port", $freeport, "font-size:13px;padding:3px;width:50px") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td colspan=2><div class=explain>{$explian}</div></td>\n\t</tr>\t\n\t<tr>\n\t\t<td colspan=2 align='right'><hr>" . button("{apply}", "dkimproxySave()") . "</td>\n\t</tr>\n\t</table>\n\t\n\t<script>\n\t\n\n\tvar x_dkimproxySave=function(obj){\n\t      var tempvalue=trim(obj.responseText);\n\t      if(tempvalue.length>3){alert(tempvalue);}\n\t\t  RefreshTab('main_config_dkimproxy');\n\t}\t\n\t\n\t\tfunction dkimproxySave(num){\n\t\t      var XHR = new XHRConnection();\n\t\t      if(document.getElementById('dkimproxyEnabled').checked){\n\t\t      \t    XHR.appendData('dkimproxyEnabled',1);\n\t\t\t\t}else{\n\t\t\t\t\tXHR.appendData('dkimproxyEnabled',0);\n\t\t\t\t}\n\t\t      XHR.appendData('ou','{$_GET["ou"]}');\n\t\t      XHR.appendData('hostname','{$_GET["hostname"]}');   \n\t\t      XHR.appendData('selector_name',document.getElementById('selector_name').value);  \n\t\t      XHR.appendData('listen_port',document.getElementById('listen_port').value);\n\t\t      XHR.appendData('method',document.getElementById('method').value);\n\n\t\t      \n\t\t      XHR.sendAndLoad('{$page}', 'GET',x_dkimproxySave);\n\t\t      \n\t\t}\n\n\tfunction CheckdkimproxyEnabled(){\n\t\tdocument.getElementById('selector_name').disabled=true;\n\t\tdocument.getElementById('listen_port').disabled=true;\n\t\tdocument.getElementById('method').disabled=true;\n\t\t\n\t\t if(document.getElementById('dkimproxyEnabled').checked){\n\t\t\t\tdocument.getElementById('selector_name').disabled=false;\n\t\t\t\tdocument.getElementById('listen_port').disabled=false;\n\t\t\t\tdocument.getElementById('method').disabled=false;\n\t\t\t}\n\t}\n\t\n\tCheckdkimproxyEnabled();\n\t</script>";
    echo $tpl->_ENGINE_parse_body($html);
}
function popup(){
	
$ssl=new ssl_certificate();
	$array=$ssl->array_ssl;
	$styleF="font-size:13px;padding:3px";
	
	
	$main=new maincf_multi($_GET["hostname"],base64_decode($_GET["ou"]));
	$conf=unserialize(base64_decode($main->GET_BIGDATA("certificate_smtp_parameters")));
	
	if($conf["organizationName"]==null){$conf["organizationName"]=base64_decode($_GET["ou"]);}
	
	$users=new usersMenus();
	$tpl=new templates();
	$country_name=Field_array_Hash($ssl->array_country_codes,'countryName',$conf["countryName"],null,null,0,$styleF);	
	$html="<div id='PostfixMultiCertificateDiv'>
	<table style='width:100%'>
	<tr>
		<td class=legend style='font-size:13px'>{countryName}:</td>	
		<td>$country_name</td>
	</tr>
	<tr>
		<td class=legend style='font-size:13px'>{localityName}:</td>
		<td>". Field_text("localityName",$conf["localityName"],$styleF)."</td>
	</tr>
	<tr>
		<td class=legend style='font-size:13px'>{organizationalUnitName}:</td>
		<td>". Field_text("organizationalUnitName",$conf["organizationalUnitName"],$styleF)."</td>
	</tr>
	<tr>
		<td class=legend style='font-size:13px'>{organizationName}:</td>
		<td>". Field_text("organizationName",$conf["organizationName"],$styleF)."</td>
	</tr>	
	
	
		<tr>
		<td class=legend style='font-size:13px'>{emailAddress}:</strong></td>
		<td align='left'>" . Field_text("emailAddress",$conf["emailAddress"],$styleF)  . "</td>
		</tr>
	<tr>
		<td colspan=2 align=right>
			<hr>
				". button("{apply}","PostfixMultiCertificateSave()")."
			</td>
	</tr>	
	</table>
	</div>
	";
	
	echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 3
0
function build_single_instance($ip)
{
    $sql = "SELECT `value`,`ou` FROM postfix_multi WHERE `key`='myhostname' AND `ip_address`='{$ip}'";
    $q = new mysql();
    $unix = new unix();
    $ldap = new clladp();
    $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, 'artica_backup'));
    $ou = $ligne["ou"];
    $hostname = $ligne["value"];
    $main = new maincf_multi($hostname, $ou);
    echo "Starting......: dkimproxy {$hostname}\n";
    $freeport = $main->GET("dkimproxy_listenport");
    $array = unserialize(base64_decode($main->GET_BIGDATA("dkimproxy_datas")));
    $unix = new unix();
    $key = "/etc/dkimproxy/{$hostname}/private.key";
    @mkdir("/etc/dkimproxy/{$hostname}", 640, true);
    if (!is_file($key)) {
        echo "Starting......: dkimproxy {$hostname} generating public and private key\n";
        $openssl = $unix->find_program("openssl");
        @mkdir("/etc/dkimproxy/{$hostname}", 640, true);
        shell_exec("{$openssl} genrsa -out /etc/dkimproxy/{$hostname}/private.key 1024");
        shell_exec("{$openssl} rsa -in /etc/dkimproxy/{$hostname}/private.key -pubout -out /etc/dkimproxy/{$hostname}/public.key");
    }
    if ($hostname == "master") {
        $domains = $ldap->AllDomains();
    } else {
        $domains = $ldap->hash_get_domains_ou($ou);
    }
    while (list($dom, $nil) = each($domains)) {
        $dd[] = $dom;
    }
    $conf[] = "# specify what address/port DKIMproxy should listen on";
    $conf[] = "listen    {$ip}:{$freeport}";
    $conf[] = "# specify what address/port DKIMproxy forwards mail to";
    $conf[] = "relay     {$ip}:33560";
    $conf[] = "# specify what domains DKIMproxy can sign for (comma-separated, no spaces)";
    $conf[] = "domain    " . @implode(",", $dd);
    $conf[] = "# specify what signatures to add";
    $conf[] = "signature dkim(c=relaxed)";
    $conf[] = "signature domainkeys(c=nofws)";
    $conf[] = "# specify location of the private key";
    $conf[] = "keyfile   /etc/dkimproxy/{$hostname}/private.key";
    $conf[] = "# specify the selector (i.e. the name of the key record put in DNS)";
    $conf[] = "selector  {$array["selector_name"]}";
    $conf[] = "min_servers 5";
    $conf[] = "min_spare_servers 2";
    $conf[] = "";
    echo "Starting......: dkimproxy {$hostname} generating {$hostname}.conf " . count($dd) . " domain(s)\n";
    @file_put_contents("/etc/dkimproxy/{$hostname}.conf", @implode("\n", $conf));
}
Esempio n. 4
0
function smtpd_client_restrictions_popup()
{
    $main = new maincf_multi($_GET["hostname"], $_GET["ou"]);
    $datas = $main->GET_BIGDATA("hash_smtp_restrictions");
    $restrictions = unserialize(base64_decode($datas));
    $EnablePostfixAntispamPack_value = $restrictions["EnablePostfixAntispamPack"];
    $reject_forged_mails = $restrictions['reject_forged_mails'];
    //$whitelists=Paragraphe("routing-domain-relay.png","{PostfixAutoBlockDenyAddWhiteList}","{PostfixAutoBlockDenyAddWhiteList_explain}","javascript:Loadjs('postfix.iptables.php?white-js=yes')");
    $rollover = CellRollOver();
    $html = "\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top' width=1%>\n\t<img src='img/96-planetes-free.png'>\n\t</td>\n\t<td valign='top'>\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top'>\n\t\t<div class=explain>{smtpd_client_restrictions_text}</div>\n\t</td>\n\t<td valign='top'>\n\t\t{$whitelists}\n\t</td>\n\t</tr>\n\t</table>\n\t\n\t</td>\n\t</tr>\n\t</table>\n\t<div id='smtpd_client_restrictions_div'>\n\t<table cellspacing='0' cellpadding='0' border='0' class='tableView'>\n\t\n\t<tr>\n\t<td valign='middle' width=1%>" . Field_checkbox("disable_vrfy_command", 1, $restrictions["disable_vrfy_command"]) . "</td>\n\t<td valign='middle' style='font-size:14px;text-transform:capitalize'>{disable_vrfy_command}</td>\n\t<td valign='middle' width=1%>" . help_icon("{disable_vrfy_command_text}") . "</td>\n\t</tr>\t\n\t\n\t<tr class=oddRow>\n\t<td valign='middle' width=1%>" . Field_checkbox("reject_unknown_client_hostname", 1, $restrictions["reject_unknown_client_hostname"]) . "</td>\n\t<td valign='middle' style='font-size:14px;text-transform:capitalize'>{reject_unknown_client_hostname}</td>\n\t<td valign='middle' width=1%>" . help_icon("{reject_unknown_client_hostname_text}") . "</td>\n\t</tr>\n\t\n\t<tr>\n\t<td valign='middle' width=1%>" . Field_checkbox("reject_unknown_reverse_client_hostname", 1, $restrictions["reject_unknown_reverse_client_hostname"]) . "</td>\n\t<td valign='middle' style='font-size:14px;text-transform:capitalize'>{reject_unknown_reverse_client_hostname}</td>\n\t<td valign='middle' width=1%>" . help_icon("{reject_unknown_reverse_client_hostname_text}") . "</td>\n\t</tr>\n\t\n\t<tr class=oddRow>\n\t<td valign='middle' width=1%>" . Field_checkbox("reject_unknown_sender_domain", 1, $restrictions["reject_unknown_sender_domain"]) . "</td>\n\t<td valign='middle' style='font-size:14px;text-transform:capitalize'>{reject_unknown_sender_domain}</td>\n\t<td valign='middle' width=1%>" . help_icon("{reject_unknown_sender_domain_text}") . "</td>\n\t</tr>\n\t\n\t<tr >\n\t<td valign='middle' width=1%>" . Field_checkbox("reject_invalid_hostname", 1, $restrictions["reject_invalid_hostname"]) . "</td>\n\t<td valign='middle' style='font-size:14px;text-transform:capitalize'>{reject_invalid_hostname}</td>\n\t<td valign='middle' width=1%>" . help_icon("{reject_invalid_hostname_text}") . "</td>\n\t</tr>\n\t<tr class=oddRow>\n\t<td valign='middle' width=1%>" . Field_checkbox("reject_non_fqdn_sender", 1, $restrictions["reject_non_fqdn_sender"]) . "</td>\n\t<td valign='middle' style='font-size:14px;text-transform:capitalize'>{reject_non_fqdn_sender}</td>\n\t<td valign='middle' width=1%>" . help_icon("{reject_non_fqdn_sender_text}") . "</td>\n\t</tr>\n\t<tr >\n\t<td valign='middle' width=1%>" . Field_checkbox("reject_forged_mails", 1, $reject_forged_mails) . "</td>\n\t<td valign='middle' style='font-size:14px;text-transform:capitalize'>{reject_forged_mails}</td>\n\t<td valign='middle' width=1%>" . help_icon("{reject_forged_mails_text}") . "</td>\n\t</tr>\t\n\t\n\t\n\t<tr class=oddRow>\n\t<td valign='middle' width=1%>" . Field_checkbox("EnablePostfixAntispamPack", 1, $EnablePostfixAntispamPack_value) . "</td>\n\t<td valign='middle' style='font-size:14px;text-transform:capitalize'>{EnablePostfixAntispamPack}</td>\n\t<td valign='middle' width=1%>" . help_icon("{EnablePostfixAntispamPack_text}") . "</td>\n\t</tr>\t\n\n\t<tr>\n\t<td valign='middle' width=1%>" . Field_checkbox("EnablePostfixInternalDomainsCheck", 1, $restrictions["EnablePostfixInternalDomainsCheck"]) . "</td>\n\t<td valign='middle' style='font-size:14px;text-transform:capitalize'>{EnablePostfixInternalDomainsCheck}</td>\n\t<td valign='middle' width=1%>" . help_icon("{EnablePostfixInternalDomainsCheck_text}") . "</td>\n\t</tr>\t\n\t<tr class=oddRow>\n\t<td valign='middle' width=1%>" . Field_checkbox("RestrictToInternalDomains", 1, $restrictions["RestrictToInternalDomains"], null, null) . "</td>\n\t<td valign='middle' style='font-size:14px;text-transform:capitalize'>{RestrictToInternalDomains}</td>\n\t<td valign='middle' width=1%>" . help_icon("{RestrictToInternalDomains_text}") . "</td>\n\t</tr>\t\t\n\t\n\t\n\t</table>\n\t</div>\n<hr>\n\t<div style='width:100%;text-align:right'>\n\t" . button("{edit}", "smtpd_client_restrictions_multi_save()") . "\n\t\n\t</div>\t\n\t";
    //smtpd_client_connection_rate_limit = 100
    //smtpd_client_recipient_rate_limit = 20
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html, "postfix.index.php");
}
function popup(){

	$page=CurrentPageName();
	$ou=$_GET["ou"];
	$hostname=$_GET["hostname"];
	$main=new maincf_multi($hostname,$ou);
	$array=unserialize(base64_decode($main->GET_BIGDATA("PostfixMultiFetchMail")));	
	$schedule=array(2=>2,5=>5,10=>10,15=>15,20=>20,30=>30,40=>40,50=>50,55=>55);
	if($array[$hostname]["schedule"]==null){$array[$hostname]["schedule"]=10;}
	
	
	$enabled=$array[$hostname]["enabled"];
	$fetchmail_enabled=Paragraphe_switch_img('{enable_fetchmail}','{enable_fetchmail_text}','enable_fetchmail',$enabled,null,270);
	
	$forms="<table style='width:100%'>
	<tr>
	<td colspan=2>$fetchmail_enabled</td>
	</tr>
	<tr>
		<td class=legend style='font-size:14px'>{fetch_messages_every}:</td>
		<td style='font-size:14px'>
		". Field_array_Hash($schedule,
		"schedule",$array[$hostname]["schedule"],null,null,0,"font-size:14px;padding:3px")."&nbsp;(minutes)</td>
	</tr>
	</table>
	
	";
	
	
	$html="
	<table style='width:100%'>
	<tr>
		<td valign='top' width=1%><img src='img/bg_fetchmail2.png'></td>
		<td valign='top'>$forms</td>
	</tr>
	<tr>
	<td colspan=2 align='right'><hr>". button("{apply}","postfix_multi_fetchmail_save()")."</td>
	</tr>
	
	</table>
	
	";
	$tpl=new templates();
	echo $tpl->_ENGINE_parse_body($html);
	
	
}
function servers_list()
{
    $tpl = new templates();
    $main = new maincf_multi($_GET["hostname"], $_GET["ou"]);
    $hash = unserialize(base64_decode($main->GET_BIGDATA("check_client_access")));
    if (!is_array($hash) or count($hash) == 0) {
        json_error_show("no rule");
    }
    $page = 1;
    $search = string_to_flexregex();
    $c = 0;
    while (list($ipaddr, $action) = each($hash)) {
        if (trim($ipaddr) == null) {
            continue;
        }
        if (isset($aL[$ipaddr])) {
            continue;
        }
        $md5 = md5("{$ipaddr}{$action}");
        if ($search != null) {
            if (!preg_match("#{$search}#", $ipaddr)) {
                continue;
            }
        }
        $aL[$md5] = true;
        $img = "48-server.png";
        if ($action == "REJECT") {
            $img = '48-server-ban.png';
        }
        $c++;
        $delete = imgsimple('delete-48.png', '{delete}', "DeleteServer{$_GET["t"]}('{$ipaddr}');");
        $data['rows'][] = array('id' => $md5, 'cell' => array("<span style='font-size:16px;font-weight:bold'><img src='img/{$img}'></a></span>", "<span style='font-size:32px'>{$ipaddr} ({$action})</a></span>", $delete));
    }
    $data['page'] = $page;
    $data['total'] = $c;
    echo json_encode($data);
}
Esempio n. 7
0
function database_save()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $ou = base64_decode($_GET["ou"]);
    $hostname = $_GET["hostname"];
    $main = new maincf_multi($hostname, $ou);
    $databases_list = unserialize(base64_decode($main->GET_BIGDATA("ActiveDirectoryDBS")));
    if ($_GET["dbindex"] == null) {
        $_GET["dbindex"] = time();
    }
    if ($_GET["query_filter"] == null) {
        $_GET["query_filter"] = "(&(objectClass=person)(mail=%s))";
    }
    if ($_GET["scope"] == null) {
        $_GET["scope"] = "sub";
    }
    $res = 0;
    if ($_GET["result_attribute"] == null) {
        $res++;
    }
    if ($_GET["leaf_result_attribute"] == null) {
        $res++;
    }
    if ($_GET["special_result_attribute"] == null) {
        $res++;
    }
    if ($res == 0) {
        $_GET["result_attribute"] = "mail";
    }
    $databases_list[$_GET["dbindex"]] = $_GET;
    $final = base64_encode(serialize($databases_list));
    $main->SET_BIGDATA("ActiveDirectoryDBS", $final);
    $sock = new sockets();
    $sock->getFrameWork("cmd.php?postfix-multi-cfdb={$hostname}");
}
Esempio n. 8
0
function multi_build_schedule($hostname)
{
    $unix = new unix();
    $fetchmail = $unix->find_program("fetchmail");
    if ($fetchmail == null) {
        return null;
    }
    $main = new maincf_multi($hostname);
    $array = unserialize(base64_decode($main->GET_BIGDATA("PostfixMultiFetchMail")));
    if ($array[$hostname]["enabled"] != 1) {
        return null;
    }
    if ($array[$hostname]["schedule"] == null) {
        return null;
    }
    if ($array[$hostname]["schedule"] < 2) {
        return null;
    }
    echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["SERVICE_NAME"]} {$hostname} scheduling each {$array[$hostname]["schedule"]}mn\n";
    return "{$array[$hostname]["schedule"]} {$fetchmail} --nodetach --fetchmailrc /etc/postfix-{$hostname}/fetchmail.rc >>/var/log/fetchmail.log";
}
function LoadLDAPDBs()
{
    if (isset($GLOBALS["LoadLDAPDBs_performed"])) {
        return;
    }
    $main = new maincf_multi("master", "master");
    $databases_list = unserialize(base64_decode($main->GET_BIGDATA("ActiveDirectoryDBS")));
    if (is_array($databases_list)) {
        while (list($dbindex, $array) = each($databases_list)) {
            if ($GLOBALS["DEBUG"]) {
                echo __FUNCTION__ . "::LDAP:: {$array["database_type"]}; enabled={$array["enabled"]}\n";
            }
            if ($array["enabled"] != 1) {
                if ($GLOBALS["DEBUG"]) {
                    echo __FUNCTION__ . "::LDAP:: {$array["database_type"]} is not enabled, skipping\n";
                }
                continue;
            }
            $targeted_file = $main->buidLdapDB("master", $dbindex, $array);
            if (!is_file($targeted_file)) {
                if ($GLOBALS["DEBUG"]) {
                    echo __FUNCTION__ . "::LDAP:: {$array["database_type"]} \"{$targeted_file}\" no such file, skipping\n";
                }
                continue;
            }
            //$GLOBALS["REMOTE_SMTP_LDAPDB_ROUTING"]
            if ($array["resolv_domains"] == 1) {
                $domains = $main->buidLdapDBDomains($array);
            }
            $GLOBALS["LDAPDBS"][$array["database_type"]][] = "ldap:{$targeted_file}";
            if ($GLOBALS["DEBUG"]) {
                echo __FUNCTION__ . "::LDAP:: GLOBALS[LDAPDBS][{$array["database_type"]}]=ldap:{$targeted_file}\n";
            }
        }
    }
    $GLOBALS["LoadLDAPDBs_performed"] = true;
}
function PostFixDeleteServerCache()
{
    $main = new maincf_multi($_POST["hostname"]);
    $smtp_connection_cache_destinations = unserialize(base64_decode($main->GET_BIGDATA("smtp_connection_cache_destinations")));
    unset($smtp_connection_cache_destinations[$_POST["PostFixDeleteServerCache"]]);
    $smtp_connection_cache_destinations_new = base64_encode(serialize($smtp_connection_cache_destinations));
    $main->SET_BIGDATA("smtp_connection_cache_destinations", addslashes($smtp_connection_cache_destinations_new));
    $sock = new sockets();
    $sock->getFrameWork("cmd.php?postfix-others-values=yes&hostname={$_POST["hostname"]}");
}
function del_host()
{
    $ou = base64_decode($_GET["ou"]);
    $main = new maincf_multi($_GET["hostname"], $ou);
    $page = CurrentPageName();
    $tpl = new templates();
    $host = base64_decode($_GET["PostFixAiguilleuseServerDelete"]);
    $PostFixAiguilleuseServers = unserialize(base64_decode($main->GET_BIGDATA("PostFixAiguilleuseServers")));
    unset($PostFixAiguilleuseServers["HOSTS"][$host]);
    unset($PostFixAiguilleuseServers[$host]);
    $final = base64_encode(serialize($PostFixAiguilleuseServers));
    $main->SET_BIGDATA("PostFixAiguilleuseServers", $final);
    $sock = new sockets();
    $sock->getFrameWork("cmd.php?postfix-multi-aiguilleuse={$_GET["hostname"]}");
}
Esempio n. 12
0
function templates_postfix_form()
{
    $template = $_GET["postfix-notifs-template"];
    $tpl = new templates();
    $page = CurrentPageName();
    $mainTPL = new bounces_templates();
    $main = new maincf_multi($_GET["hostname"]);
    $array = unserialize(base64_decode($main->GET_BIGDATA($template)));
    if (!is_array($array)) {
        $array = $mainTPL->templates_array[$template];
    }
    $html = "\n\t\t<div id='ffm1notif2'>\n\t\t<div class=explain>{{$template}}</div>\n\t\t<table style='width:100%' class=form>\n\t\t<tr>\n\t\t\t<td class=legend>Charset:</td>\n\t\t\t<td>" . Field_text('Charset', $array["Charset"], 'width:90px;font-size:13px;padding:3px') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend>{mail_from}:</td>\n\t\t\t<td>" . Field_text('From', $array["From"], 'width:200px;font-size:13px;padding:3px') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend>{subject}:</td>\n\t\t\t<td>" . Field_text('Subject', $array["Subject"], 'width:290px;font-size:13px;padding:3px') . "</td>\n\t\t</tr>\t\n\t\t<tr>\n\t\t\t<td class=legend>Postmaster-Subject:</td>\n\t\t\t<td>" . Field_text('Postmaster-Subject', $array["Postmaster-Subject"], 'width:290px;font-size:13px;padding:3px') . "</td>\n\t\t</tr>\t\n\t\t<tr>\n\t\t\t<td valign='top' colspan=2 align='right'>\n\t\t\t" . button("{apply}", "SavePostfixNotifTemplateForm()") . "\n\t\t\t</td>\n\t\t\t\n\t\t</tr>\t\n\t\t<tr>\n\t\t\t<td valign='top' colspan=2><textarea id='template-Body' style=';font-size:13px;padding:3px;width:100%;border:1px dotted #CCCCCC;height:200px;margin:4px;padding:4px'>{$array["Body"]}</textarea></td>\n\t\t</tr>\n\t\t\t\n\t\t</table>\n\n\t<script>\n\t\n\tvar x_SavePostfixNotifTemplateForm= function (obj) {\n\t\tvar results=trim(obj.responseText);\n\t\tif(results.length>0){alert(results);}\n\t\tYahooWin4Hide();\n\t\tRefreshTab('main_config_postfix_notifs');\n\t}\t\n\t\n\tfunction SavePostfixNotifTemplateForm(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('Charset',document.getElementById('Charset').value);\n\t\tXHR.appendData('From',document.getElementById('From').value);\n\t\tXHR.appendData('Subject',document.getElementById('Subject').value);\n\t\tXHR.appendData('Postmaster-Subject',document.getElementById('Postmaster-Subject').value);\n\t\tXHR.appendData('Body',document.getElementById('template-Body').value);\n\t\tXHR.appendData('hostname','{$_GET["hostname"]}');\n\t\tXHR.appendData('template_save','{$template}');\t\t\n\t\tdocument.getElementById('ffm1notif2').innerHTML='<div style=\"width:100%\"><center style=\"margin:20px;padding:20px\"><img src=\"img/wait_verybig.gif\"></center></div>';\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_SavePostfixNotifTemplateForm);\n\t}\n\t\t\n\t\n\t</script>\t\t\n\t\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 13
0
function status_list()
{
    $users = new usersMenus();
    $users->LoadModulesEnabled();
    $sock = new sockets();
    $tpl = new templates();
    $users = new usersMenus();
    $users->LoadModulesEnabled();
    $sock = new sockets();
    $EnableArticaSMTPFilter = $sock->GET_INFO("EnableArticaSMTPFilter");
    $EnableArticaSMTPFilter = 0;
    $EnableArticaPolicyFilter = $sock->GET_INFO("EnableArticaPolicyFilter");
    $EnableArticaPolicyFilter = 0;
    $EnablePostfixMultiInstance = $sock->GET_INFO("EnablePostfixMultiInstance");
    $amavis = Paragraphe_switch_disable('{enable_amavis}', '{feature_not_installed}', '{feature_not_installed}');
    $assp = Paragraphe_switch_disable('{enable_assp}', '{feature_not_installed}', '{feature_not_installed}');
    $main = new maincf_multi("master");
    $array_filters = unserialize(base64_decode($main->GET_BIGDATA("PluginsEnabled")));
    $array["APP_POSTFWD2"]["INSTALLED"] = True;
    $array["APP_POSTFWD2"]["NAME"] = "APP_POSTFWD2";
    $array["APP_POSTFWD2"]["ENABLED"] = $array_filters["APP_POSTFWD2"];
    $array["APP_POSTFWD2"]["TEXT"] = "POSTFWD2_ABOUT";
    $array["APP_POSTFWD2"]["JS"] = "Loadjs('postfwd2.php?instance=master&with-popup=yes')";
    $array["MILTER_GREYLIST"]["INSTALLED"] = False;
    $array["MILTER_GREYLIST"]["NAME"] = "APP_MILTERGREYLIST";
    $array["AMAVISD"]["INSTALLED"] = False;
    $array["AMAVISD_MILTER"]["INSTALLED"] = False;
    $array["AMAVISD"]["NAME"] = "APP_AMAVISD_NEW";
    $array["SPAMASSASSIN"]["INSTALLED"] = False;
    $array["SPAMASS_MILTER"]["INSTALLED"] = False;
    $array["CLAMAV"]["INSTALLED"] = False;
    $array["APP_MILTER_DKIM"]["INSTALLED"] = False;
    $array["APP_MILTER_DKIM"]["NAME"] = "APP_MILTER_DKIM";
    $array["APP_MILTER_DKIM"]["TEXT"] = "dkim_about";
    $array["FRESHCLAM"]["INSTALLED"] = False;
    $array["FRESHCLAM"]["NAME"] = "APP_FRESHCLAM";
    $array["APP_CLUEBRINGER"]["INSTALLED"] = False;
    $array["DKIM_FILTER"]["INSTALLED"] = False;
    $array["DKIM_FILTER"]["NAME"] = "APP_DKIM_FILTER";
    $array["SPFMILTER"]["INSTALLED"] = False;
    $array["SPFMILTER"]["NAME"] = "APP_SPFMILTER";
    $array["APP_CLUEBRINGER"]["NAME"] = "APP_CLUEBRINGER";
    $array["MAILSPY"]["INSTALLED"] = False;
    $array["MAILSPY"]["NAME"] = "APP_MAILSPY";
    $array["KAVMILTER"]["INSTALLED"] = False;
    $array["KAS_MILTER"]["INSTALLED"] = False;
    $array["KAS3"]["INSTALLED"] = False;
    $array["BOGOM"]["INSTALLED"] = False;
    $array["BOGOM"]["NAME"] = "APP_BOGOM";
    $array["POLICYD_WEIGHT"]["INSTALLED"] = False;
    //$array["APP_ARTICA_POLICY"]["INSTALLED"]=False;
    $array["AMAVISD_MILTER"]["NAME"] = "APP_AMAVISD_MILTER";
    $array["KAS3"]["NAME"] = "APP_KAS3_MILTER";
    $array["SPAMASS_MILTER"]["NAME"] = "APP_SPAMASS_MILTER";
    $array["SPAMASSASSIN"]["NAME"] = "APP_SPAMASSASSIN";
    $array["KAVMILTER"]["NAME"] = "APP_KAVMILTER";
    $array["KAS_MILTER"]["NAME"] = "APP_KAS3_MILTER";
    $array["ASSP"]["INSTALLED"] = False;
    $array["ASSP"]["NAME"] = "APP_ASSP";
    if ($users->SPAMASS_MILTER_INSTALLED) {
        $array["SPAMASS_MILTER"]["INSTALLED"] = true;
        $array["SPAMASS_MILTER"]["TEXT"] = "feature_not_installed";
        $array["SPAMASS_MILTER"]["ENABLED"] = $users->SpamAssMilterEnabled;
        $array["SPAMASS_MILTER"]["TOKEN"] = "enable_spamassassin";
        $array["SPAMASS_MILTER"]["JS"] = "Loadjs('postfix.index.php?script=antispam')";
    }
    if ($users->DKIMFILTER_INSTALLED) {
        $array["DKIM_FILTER"]["INSTALLED"] = true;
    }
    if ($users->spamassassin_installed) {
        $APP_SPAMASSASSIN_TEXT = $tpl->_ENGINE_parse_body("{APP_SPAMASSASSIN_TEXT}");
        $spamassassin_in_amavis_text = $tpl->_ENGINE_parse_body("{spamassassin_in_amavis_text}");
        $array["SPAMASSASSIN"]["INSTALLED"] = True;
        $array["SPAMASSASSIN"]["TEXT"] = "{$APP_SPAMASSASSIN_TEXT}<br>{$spamassassin_in_amavis_text}";
        $array["SPAMASSASSIN"]["ENABLED"] = $users->EnableAmavisDaemon;
        $array["SPAMASSASSIN"]["LOCK"] = true;
        $array["SPAMASSASSIN"]["JS"] = "Loadjs('postfix.index.php?script=antispam')";
    } else {
        $array["SPAMASSASSIN"]["JS-INSTALL"] = "Loadjs('spamassassin.install.php');";
        //APP_SPAMASSASSIN
    }
    if ($users->AMAVIS_INSTALLED) {
        $array["AMAVISD"]["INSTALLED"] = true;
        $array["AMAVISD"]["TEXT"] = "enable_amavis_text";
        $array["AMAVISD"]["ENABLED"] = $users->EnableAmavisDaemon;
        $array["AMAVISD"]["TOKEN"] = "enable_amavis";
        $array["AMAVISD"]["JS"] = "Loadjs('amavis.index.php?ajax=yes')";
        //
        if ($users->EnableAmavisDaemon == 1) {
            $array["SPAMASS_MILTER"]["INSTALLED"] = true;
            $array["SPAMASS_MILTER"]["TEXT"] = "spamassassin_in_amavis_text";
            $array["SPAMASS_MILTER"]["ENABLED"] = 0;
            $array["SPAMASS_MILTER"]["LOCK"] = true;
        }
    } else {
        $array["AMAVISD"]["JS-INSTALL"] = "Loadjs('amavisd.install.php');";
    }
    if ($users->CLAMD_INSTALLED) {
        $EnableClamavDaemon = $sock->GET_INFO("EnableClamavDaemon");
        if (!is_numeric($EnableClamavDaemon)) {
            $EnableClamavDaemon = 0;
        }
        $EnableClamavDaemonForced = $sock->GET_INFO("EnableClamavDaemonForced");
        if (!is_numeric($EnableClamavDaemonForced)) {
            $EnableClamavDaemonForced = 0;
        }
        if ($EnableClamavDaemonForced == 1) {
            $EnableClamavDaemon = 1;
        }
        $array["CLAMAV"]["JS"] = "Loadjs('clamav.enable.php')";
        $array["CLAMAV"]["INSTALLED"] = True;
        $array["CLAMAV"]["ENABLED"] = $EnableClamavDaemon;
        $array["CLAMAV"]["TOKEN"] = "EnableClamavDaemon";
    }
    if ($users->MILTERGREYLIST_INSTALLED) {
        $array["MILTER_GREYLIST"]["INSTALLED"] = True;
        $array["MILTER_GREYLIST"]["TEXT"] = "enable_miltergreylist_text";
        $array["MILTER_GREYLIST"]["ENABLED"] = $users->MilterGreyListEnabled;
        $array["MILTER_GREYLIST"]["TOKEN"] = "MilterGreyListEnabled";
        $array["MILTER_GREYLIST"]["JS"] = "Loadjs('postfix.index.php?script=antispam')";
        //MilterGreyListEnabled
    }
    if ($users->KAV_MILTER_INSTALLED) {
        $array["KAVMILTER"]["INSTALLED"] = True;
        $array["KAVMILTER"]["TEXT"] = "enable_kavmilter_text";
        $array["KAVMILTER"]["ENABLED"] = $users->KAVMILTER_ENABLED;
        $array["KAVMILTER"]["TOKEN"] = "kavmilterEnable";
        $array["KAVMILTER"]["JS"] = "Loadjs('postfix.index.php?script=antispam')";
        //kavmilterEnable
    }
    if ($users->kas_installed) {
        $array["KAS3"]["INSTALLED"] = True;
        $array["KAS3"]["TEXT"] = "enable_kaspersky_as_text";
        $array["KAS3"]["ENABLED"] = $users->KasxFilterEnabled;
        $array["KAS3"]["TOKEN"] = "enable_kaspersky_as";
        $array["KAS3"]["JS"] = "Loadjs('postfix.index.php?script=antispam')";
        //enable_kaspersky_as
    }
    //
    /*	if($users->ASSP_INSTALLED){
    		$sock=new sockets();
    		$EnableASSP=$sock->GET_INFO('EnableASSP');
    		$assp=Paragraphe_switch_img('{enable_assp}','{enable_assp_text}','EnableASSP',$EnableASSP,'{enable_disable}',290);
    	}
    */
    if (!$users->MEM_HIGER_1G) {
        $array["AMAVISD"]["TEXT"] = "ressources_insuffisantes";
        $array["SPAMASS_MILTER"]["TEXT"] = "ressources_insuffisantes";
        $array["SPAMASSASSIN"]["TEXT"] = "ressources_insuffisantes";
    }
    if ($users->KASPERSKY_SMTP_APPLIANCE) {
        unset($array["AMAVISD"]);
        unset($array["SPAMASS_MILTER"]);
        unset($array["SPAMASSASSIN"]);
    }
    if ($users->CLUEBRINGER_INSTALLED) {
        $array["APP_CLUEBRINGER"]["INSTALLED"] = True;
        $array["APP_CLUEBRINGER"]["TEXT"] = "enable_cluebringer_text";
        $EnableCluebringer = $sock->GET_INFO("EnableCluebringer");
        $array["APP_CLUEBRINGER"]["ENABLED"] = $EnableCluebringer;
        $array["APP_CLUEBRINGER"]["TOKEN"] = "EnableCluebringer";
        //
    }
    if (is_file("ressources/logs/global.status.ini")) {
        $ini = new Bs_IniHandler("ressources/logs/global.status.ini");
    } else {
        writelogs("ressources/logs/global.status.ini no such file");
        $sock = new sockets();
        $datas = base64_decode($sock->getFrameWork('cmd.php?Global-Applications-Status=yes'));
        $ini = new Bs_IniHandler($datas);
    }
    $sock = new sockets();
    $datas = $sock->getFrameWork('cmd.php?refresh-status=yes');
    //$activate=Paragraphe('64-folder-install.png','{AS_ACTIVATE}','{AS_ACTIVATE_TEXT}',"javascript:Loadjs('postfix.index.php?script=antispam')",null,210,null,0,true);
    $tr[] = DAEMON_STATUS_ROUND($ligne, $ini, null, 1);
    $html = "\n<table cellspacing='0' cellpadding='0' border='0' class='tableView' style='width:100%'>\n<thead class='thead'>\n\t<tr>\n\t<th>{service}</th>\n\t<th>{version}</th>\n\t<th>{installed}</th>\n\t<th>{enabled}</th>\n\t<th>{running}</th>\n\t</tr>\n</thead>\n<tbody class='tbody'>";
    //print_r($ini->_params);
    if ($_GET["search"] != null) {
        $search = "*{$_GET["search"]}*";
        $search = str_replace(".", "\\.", $search);
        $search = str_replace("(", "\\(", $search);
        $search = str_replace(")", "\\)", $search);
        $search = str_replace("**", "*", $search);
        $search = str_replace("**", "*", $search);
        $search = str_replace("*", ".*?", $search);
    }
    while (list($key, $arrayConf) = each($array)) {
        $servicename = null;
        $enabled = NULL;
        $installed = null;
        $fontColor = "black";
        $version = "&nbsp;";
        $running = null;
        $since = null;
        $memory = null;
        $text = null;
        $ahref = null;
        if (isset($ini->_params[$key]["service_name"])) {
            $servicename = "{{$ini->_params[$key]["service_name"]}}";
        }
        if ($servicename == null) {
            if (isset($arrayConf["NAME"])) {
                $servicename = "{{$arrayConf["NAME"]}}";
            }
        }
        if ($servicename == null) {
            $servicename = $key;
        }
        $servicename = $tpl->_ENGINE_parse_body($servicename);
        if ($arrayConf["INSTALLED"]) {
            $installed = "<img src='img/check-32.png'>";
        } else {
            if ($ini->_params[$key]["application_installed"] == 1) {
                $installed = "<img src='img/check-32.png'>";
                $arrayConf["JS"] = null;
            }
        }
        if (isset($arrayConf["JS-INSTALL"])) {
            $arrayConf["JS"] = $arrayConf["JS-INSTALL"];
        }
        if (isset($ini->_params[$key]["master_version"])) {
            $version = $ini->_params[$key]["master_version"];
        }
        $clickToInstall = null;
        if ($installed == null) {
            if ($_GET["installed"] == 1) {
                continue;
            }
            if (!isset($arrayConf["JS-INSTALL"])) {
                $fontColor = "#B5B5B5";
            }
            $installed = "&nbsp;";
            if (isset($arrayConf["TEXT"])) {
                if (strpos($arrayConf["TEXT"], "}") > 0) {
                    $text = $tpl->_ENGINE_parse_body($arrayConf["TEXT"]);
                } else {
                    $text = $tpl->_ENGINE_parse_body("{{$arrayConf["TEXT"]}}");
                }
                $text = "<hr>" . wordwrap($text, 95, "<br>") . "";
                $text = str_replace("\n", "", $text);
                $text = str_replace("\r", "", $text);
                $text = str_replace("<br><br>", "<br>", $text);
            }
            if (isset($arrayConf["JS-INSTALL"])) {
                $clickToInstall = "&nbsp;<span style='font-color:#C50000;font-size:10px'>{click_to_install}</strong><br>";
            }
            $text = "{feature_not_installed}{$text}";
        }
        if (isset($arrayConf["ENABLED"])) {
            if ($arrayConf["ENABLED"] == 1) {
                $enabled = imgtootltip("check-32.png", "{enable_disable}", "Loadjs('postfix.index.php?script=antispam')");
            } else {
                if ($_GET["enabled"] == 1) {
                    continue;
                }
                $enabled = imgtootltip("check-32-grey.png", "{enable_disable}", "Loadjs('postfix.index.php?script=antispam')");
            }
        } else {
            if (isset($ini->_params[$key]["service_disabled"])) {
                if ($ini->_params[$key]["service_disabled"] == 1) {
                    if ($_GET["enabled"] == 1) {
                        continue;
                    }
                    $enabled = imgtootltip("check-32.png", "{enable_disable}", "Loadjs('postfix.index.php?script=antispam')");
                }
            }
        }
        if ($search != null) {
            if (!preg_match("#{$search}#i", $servicename)) {
                continue;
            }
        }
        if ($enabled != null) {
            if (isset($ini->_params[$key]["running"])) {
                if ($ini->_params[$key]["running"] == 1) {
                    $running = "<img src='img/ok32.png'>";
                    $memory = "&nbsp;{memory}:<span style='font-weight:bolder'> " . FormatBytes($ini->_params[$key]["master_memory"]) . " </span>/ {virtual_memory}: <span style='font-weight:bolder'>" . FormatBytes($ini->_params[$key]["master_cached_memory"]) . "</span> ";
                    $since = "&nbsp;{since}: <span style='font-weight:bolder;color:#AB3106'>{$ini->_params[$key]["uptime"]}</span>";
                } else {
                    $running = "<img src='img/okdanger32.png'>";
                }
            }
        }
        if ($text == null) {
            if (isset($arrayConf["TEXT"])) {
                $text = $tpl->_ENGINE_parse_body("{{$arrayConf["TEXT"]}}");
                $text = str_replace("\n", "", $text);
                $text = wordwrap($text, 95, "<br>");
                $text = str_replace("\n", "", $text);
                $text = str_replace("\r", "", $text);
                $text = str_replace("<br><br>", "<br>", $text);
            }
        }
        if ($arrayConf["JS"] != null) {
            $ahref = "<a href=\"javascript:blur();\" OnClick=\"javascript:{$arrayConf["JS"]}\"\n\t\t\tstyle='font-size:14px;color:{$fontColor};text-decoration:underline;font-weight:bold'>";
        }
        if ($running == null) {
            $running = "<img src='img/ok32-grey.png'>";
        }
        if ($enabled == null) {
            $enabled = "&nbsp;";
        }
        if ($memory == null) {
            $memory = "&nbsp;";
        }
        if ($since == null) {
            $since = "&nbsp;";
        }
        if ($classtr == "oddRow") {
            $classtr = null;
        } else {
            $classtr = "oddRow";
        }
        if (strlen($text) > 290) {
            $text = substr($text, 0, 290) . "...";
        }
        $html = $html . "\n\t\t<tr class={$classtr}>\n\t\t\t<td width=100% align='left'>\n\t\t\t\t<strong style='font-size:14px;color:{$fontColor}' align='left'>{$ahref}{$servicename}{$clickToInstall}</a></strong>\n\t\t\t\t<div style='font-size:11px;color:{$fontColor};'>{$text}{$memory}{$since}</div>\n\t\t\t\t\n\t\t\t\t</a></td>\n\t\t\t<td width=1% align='left'><strong style='font-size:14px;color:{$fontColor}' align='center'>{$version}</a></td>\n\t\t\t<td width=1% nowrap align='center'>{$installed}</a></td>\n\t\t\t<td width=1% nowrap align='center'>{$enabled}</td>\n\t\t\t<td  width=1% nowrap align='center'>{$running}</td>\n\t\t\t\n\t\t</tr>";
    }
    $datas = $tpl->_ENGINE_parse_body($html . "</table>");
    echo $datas;
}
Esempio n. 14
0
function PostfixAddFallBackServerMove()
{
    $main = new main_cf();
    $main = new maincf_multi($_GET["hostname"]);
    $hash = explode(',', $main->GET_BIGDATA("smtp_fallback_relay"));
    $newarray = array_move_element($hash, $hash[$_GET["PostfixAddFallBackServerMove"]], $_GET["move"]);
    $main->SET_BIGDATA("smtp_fallback_relay", implode(",", $newarray));
}
Esempio n. 15
0
function config_notification()
{
    $page = CurrentPageName();
    $hostname = $_GET["hostname"];
    $ou = $_GET["ou"];
    $page = CurrentPageName();
    $main = new maincf_multi($_GET["hostname"], base64_decode($_GET["ou"]));
    $conf = unserialize(base64_decode($main->GET_BIGDATA("amavis_config")));
    $users = new usersMenus();
    $tpl = new templates();
    $mailfrom_notify_admin = $tpl->_ENGINE_parse_body("{mailfrom_notify_admin}:");
    $mailfrom_notify_recip = $tpl->_ENGINE_parse_body("{mailfrom_notify_recip}:");
    $mailfrom_notify_spamadmin = $tpl->_ENGINE_parse_body("{mailfrom_notify_spamadmin}:");
    $mailfrom_notify = $tpl->_ENGINE_parse_body("{mailfrom_notify}:");
    $virus_admin = $tpl->_ENGINE_parse_body("{virus_admin}:");
    $warnbadhsender = $tpl->_ENGINE_parse_body("{warnbadhsender}:");
    $warnbadhrecip = $tpl->_ENGINE_parse_body("{warnbadhrecip}:");
    $warnvirusrecip = $tpl->_ENGINE_parse_body("{warnvirusrecip}:");
    $warnbannedrecip = $tpl->_ENGINE_parse_body("{warnbannedrecip}:");
    $sytrip_text = 50;
    $sytrip_text_ = $sytrip_text - 3;
    if (strlen($mailfrom_notify_admin) > $sytrip_text) {
        $mailfrom_notify_admin = texttooltip(substr($mailfrom_notify_admin, $sytrip_text_) . "...:", $mailfrom_notify_admin);
    }
    if (strlen($mailfrom_notify_recip) > $sytrip_text) {
        $mailfrom_notify_recip = texttooltip(substr($mailfrom_notify_recip, 0, $sytrip_text_) . "...:", $mailfrom_notify_recip);
    }
    if (strlen($mailfrom_notify_spamadmin) > $sytrip_text) {
        $mailfrom_notify_spamadmin = texttooltip(substr($mailfrom_notify_spamadmin, 0, $sytrip_text_) . "...:", $mailfrom_notify_spamadmin);
    }
    if (strlen($mailfrom_notify) > $sytrip_text) {
        $mailfrom_notify = texttooltip(substr($mailfrom_notify, 0, $sytrip_text_) . "...:", $mailfrom_notify);
    }
    if (strlen($virus_admin) > $sytrip_text) {
        $virus_admin = texttooltip(substr($virus_admin, 0, $sytrip_text_) . "...:", $virus_admin);
    }
    if (strlen($warnbadhsender) > $sytrip_text) {
        $warnbadhsender = texttooltip(substr($warnbadhsender, 0, $sytrip_text_) . "...:", $warnbadhsender);
    }
    if (strlen($warnbadhrecip) > $sytrip_text) {
        $warnbadhrecip = texttooltip(substr($warnbadhrecip, 0, $sytrip_text_) . "...:", $warnbadhrecip);
    }
    if (strlen($warnvirusrecip) > $sytrip_text) {
        $warnvirusrecip = texttooltip(substr($warnvirusrecip, 0, $sytrip_text_) . "...:", $warnvirusrecip);
    }
    if (strlen($warnbannedrecip) > $sytrip_text) {
        $warnbannedrecip = texttooltip(substr($warnbannedrecip, 0, $sytrip_text_) . "...:", $warnbannedrecip);
    }
    if ($conf["virus_admin"] == "undef") {
        $conf["virus_admin"] = null;
    }
    $html = "\n\t\n\t<p style='font-size:13px'>{notification_text}</p>\n\t<div style='amavis_notifs'>\n\t<table style='width:100%'>\t\n\t<tr>\n\t\t<td colspan=2><H3>{mailfrom_notify}:</h3></td>\n\t</tR>\n\t\n\t\n\t\n\t\t<tr>\n\t\t\t<td class=legend nowrap>{$mailfrom_notify_admin}</td>\n\t\t\t<td width=1%>" . Field_text('mailfrom_notify_admin', $conf["mailfrom_notify_admin"], 'width:180px') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend nowrap>{$mailfrom_notify_recip}</td>\n\t\t\t<td width=1%>" . Field_text('mailfrom_notify_recip', $conf["mailfrom_notify_recip"], 'width:180px') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend nowrap>{$mailfrom_notify_spamadmin}</td>\n\t\t\t<td width=1%>" . Field_text('mailfrom_notify_spamadmin', $conf["mailfrom_notify_spamadmin"], 'width:180px') . "</td>\n\t\t</tr>\t\t\t\t\n\t</tr>\n\t<tr>\n\t\t<td colspan=2><H3 style='margin-top:5px'>{smtp_notification}:</h3></td>\n\t</tR>\t\n\t\t<tr>\n\t\t\t<td class=legend nowrap>{$virus_admin}</td>\n\t\t\t<td width=1%>" . Field_text('virus_admin', $conf["virus_admin"], 'width:180px') . "</td>\n\t\t</tr>\t\n\t<tr>\n\t\t<td class=legend nowrap>{$warnbadhsender}</td>\n\t\t<td width=1%>" . Field_numeric_checkbox_img('warnbadhsender', $conf["warnbadhsender"], '{enable_disable}') . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend nowrap>{$warnbadhrecip}</td>\n\t\t<td width=1%>" . Field_numeric_checkbox_img('warnbadhrecip', $conf["warnbadhrecip"], '{enable_disable}') . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend nowrap>{$warnvirusrecip}</td>\n\t\t<td width=1%>" . Field_numeric_checkbox_img('warnvirusrecip', $conf["warnvirusrecip"], '{enable_disable}') . "</td>\n\t</tr>\t\t\n\t<tr>\n\t\t<td class=legend nowrap>{$warnbannedrecip}</td>\n\t\t<td width=1%>" . Field_numeric_checkbox_img('warnbannedrecip', $conf["warnbannedrecip"], '{enable_disable}') . "</td>\n\t</tr>\t\t\n\t<tr>\n\t\t<td colspan=2 align='right'>\n\t\t<hr>\n\t\t\t" . button("{apply}", "amavis_multi_notifs_save()") . "\n\t</tr>\t\n\t</table>\n\t</div>\n\t\n\t<script>\n\tvar x_amavis_multi_notifs_save= function (obj) {\n\t\t\tvar tempvalue=obj.responseText;\n\t\t\tif(tempvalue.length>3){alert(tempvalue)};\n\t\t\tRefreshTab('main_config_amavis_multi');\n\t\t}\n\t\n\t\n\t\tfunction amavis_multi_notifs_save(){\n\t      var XHR = new XHRConnection();\n\t      XHR.appendData('mailfrom_notify_admin',document.getElementById('mailfrom_notify_admin').value);\n\t      XHR.appendData('mailfrom_notify_spamadmin',document.getElementById('mailfrom_notify_spamadmin').value);\n\t      XHR.appendData('virus_admin',document.getElementById('virus_admin').value);\n\t      XHR.appendData('warnbadhsender',document.getElementById('warnbadhsender').value);\n\t      XHR.appendData('warnbadhrecip',document.getElementById('warnbadhrecip').value);\n\t      XHR.appendData('warnvirusrecip',document.getElementById('warnvirusrecip').value);\n\t      XHR.appendData('warnbannedrecip',document.getElementById('warnbannedrecip').value);\n\t\t  XHR.appendData('hostname','{$hostname}');\n\t\t  XHR.appendData('ou','{$ou}');     \n\t\t  document.getElementById('amavis_notifs').innerHTML='<center style=\"margin:20px;padding:20px\"><img src=\"img/wait_verybig.gif\"></center>';\n\t\t  XHR.sendAndLoad('{$page}', 'GET',x_amavis_multi_notifs_save);\t\t\n\t\t\n\t\t}\n\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 16
0
function aiguilleuse($hostname)
{
    $maincf = new maincf_multi($hostname);
    $PostFixEnableAiguilleuse = $maincf->GET("PostFixEnableAiguilleuse");
    if ($PostFixEnableAiguilleuse != 1) {
        return;
    }
    if (!is_dir("/etc/postfix-{$hostname}")) {
        @mkdir("/etc/postfix-{$hostname}", 0755, true);
    }
    echo "Starting......: " . date("H:i:s") . " Postfix \"{$hostname}\" save internal-routed parameters\n";
    @file_put_contents("/etc/postfix-{$hostname}/aiguilleur.db", base64_decode($maincf->GET_BIGDATA("PostFixAiguilleuseServers")));
}
function filters()
{
    $_GET["ou"] = $_SESSION["ou"];
    $main = new maincf_multi($_GET["hostname"], $_GET["ou"]);
    $tpl = new templates();
    $sock = new sockets();
    $page = CurrentPageName();
    $array_filters = unserialize(base64_decode($main->GET_BIGDATA("PluginsEnabled")));
    $ou_encoded = base64_encode($_GET["ou"]);
    $KasxFilterEnabled = $sock->GET_INFO("KasxFilterEnabled");
    $kavmilterEnable = $sock->GET_INFO("kavmilterEnable");
    $EnableArticaSMTPFilter = $sock->GET_INFO("EnableArticaSMTPFilter");
    $EnableArticaSMTPFilter = 0;
    $EnableDKFilter = $sock->GET_INFO("EnableDKFilter");
    $EnableDkimMilter = $sock->GET_INFO("EnableDkimMilter");
    $EnableCluebringer = $sock->GET_INFO("EnableCluebringer");
    $users = new usersMenus();
    $sock = new sockets();
    if ($users->kas_installed) {
        if ($KasxFilterEnabled == 1) {
            $array["APP_KAS3"] = $array_filters["APP_KAS3"];
        }
    }
    if ($users->KAV_MILTER_INSTALLED) {
        if ($kavmilterEnable == 1) {
            $array["APP_KAVMILTER"] = $array_filters["APP_KAVMILTER"];
        }
    }
    if ($users->MILTERGREYLIST_INSTALLED) {
        $array["APP_MILTERGREYLIST"] = $array_filters["APP_MILTERGREYLIST"];
    }
    if ($users->AMAVIS_INSTALLED) {
        $array["APP_AMAVIS"] = $array_filters["APP_AMAVIS"];
    }
    if ($users->OPENDKIM_INSTALLED) {
        if ($EnableDKFilter == 1) {
            $array["APP_OPENDKIM"] = $array_filters["APP_OPENDKIM"];
        }
    }
    if ($users->MILTER_DKIM_INSTALLED) {
        if ($EnableDkimMilter == 1) {
            $array["APP_MILTER_DKIM"] = $array_filters["APP_MILTER_DKIM"];
        }
    }
    if ($users->CLUEBRINGER_INSTALLED) {
        if ($EnableCluebringer == 1) {
            $array["APP_CLUEBRINGER"] = $array_filters["APP_CLUEBRINGER"];
        }
    }
    if ($EnableArticaSMTPFilter == 1) {
        $array["APP_ARTICA_FILTER"] = $array_filters["APP_ARTICA_FILTER"];
    }
    $array["APP_POSTFWD2"] = $array_filters["APP_POSTFWD2"];
    if ($array["APP_KAS3"] == 1) {
        $tr[] = Paragraphe("folder-caterpillar-64.png", "{as_plugin}", "{kaspersky_anti_spam_text}", "javascript:Loadjs('domains.edit.kas.php?ou={$ou_encoded}')");
    }
    if ($array["APP_KAVMILTER"] == 1) {
        $tr[] = Paragraphe("icon-antivirus-64.png", "{antivirus}", "{antivirus_text}", "javascript:Loadjs('domains.edit.kavmilter.ou.php?ou={$ou_encoded}')");
    }
    if ($array["APP_MILTERGREYLIST"] == 1) {
        $tr[] = Paragraphe("64-milter-greylist.png", "{APP_MILTERGREYLIST}", "{APP_MILTERGREYLIST_TEXT}", "javascript:Loadjs('domains.postfix.multi.milter-greylist.php?ou={$ou_encoded}&hostname={$_GET["hostname"]}')");
    }
    if ($array["APP_AMAVIS"] == 1) {
        $tr[] = Paragraphe("64-amavis.png", "{APP_AMAVISD_NEW}", "{APP_AMAVISD_NEW_ICON_TEXT}", "javascript:Loadjs('domains.postfix.multi.amavis.php?ou={$ou_encoded}&hostname={$_GET["hostname"]}')");
    }
    if ($array["APP_POSTFWD2"] == 1) {
        $tr[] = Paragraphe("Firewall-Secure-64.png", "{APP_POSTFWD2}", "{APP_POSTFWD2_TEXT}", "javascript:Loadjs('postfwd2.php?ou={$ou_encoded}&instance={$_GET["hostname"]}&byou=yes')");
    } else {
        $tr[] = Paragraphe("Firewall-Secure-64-grey.png", "{APP_POSTFWD2}", "{APP_POSTFWD2_TEXT}", "javascript:Loadjs('postfwd2.php?ou={$ou_encoded}&instance={$_GET["hostname"]}&byou=yes')");
    }
    $tr[] = Paragraphe("bg_forbiden-attachmt-64.png", "{attachment_blocking}", "{attachment_blocking_text}", "javascript:Loadjs('domains.edit.attachblocking.ou.php?ou={$ou_encoded}&hostname={$_GET["hostname"]}')");
    $html = CompileTr4($tr);
    $html = $tpl->_ENGINE_parse_body($html);
    echo $html;
    SET_CACHED(__FILE__, __FUNCTION__, "{$_GET["hostname"]}&ou={$_GET["ou"]}", $html);
}
function postfix_network_table(){
	
	$main=new maincf_multi($_GET["hostname"],$_GET["ou"]);
	$nets=unserialize($main->GET_BIGDATA("mynetworks"));
	
	$html="<center>
<table cellspacing='0' cellpadding='0' border='0' class='tableView' style='width:100%'>
<thead class='thead'>
	<tr>
	<th colspan=3>{networks}</th>
	</tr>
</thead>
<tbody class='tbody'>";		

	if(is_array($nets)){
			while (list ($num, $val) = each ($nets) ){
				if($classtr=="oddRow"){$classtr=null;}else{$classtr="oddRow";}
				if(trim($val)==null){continue;}
				$html=$html . "
				<tr class=$classtr>
					<td width=1%><img src='img/folder-network-32.png'></td>
					<td style='font-size:16px'>$val</td>
					<td  width=1%>" . imgtootltip('delete-32.png','{delete} {network}',"PostFixDeleteMyNetwork($num)") ."</td>
				</tr>";
			}
		}
	
	$html=$html . "
	</tbody>
	</table>
	</center>";

	$tpl=new templates();
	echo $tpl->_ENGINE_parse_body($html);		
}
Esempio n. 19
0
function postfix_templates()
{
    $mainTPL = new bounces_templates();
    $main = new maincf_multi("master");
    $mainTemplates = new bounces_templates();
    $conf = null;
    $double_bounce_sender = $main->GET("double_bounce_sender");
    $address_verify_sender = $main->GET("address_verify_sender");
    $twobounce_notice_recipient = $main->GET("2bounce_notice_recipient");
    $error_notice_recipient = $main->GET("error_notice_recipient");
    $delay_notice_recipient = $main->GET("delay_notice_recipient");
    $empty_address_recipient = $main->GET("empty_address_recipient");
    $sock = new sockets();
    $PostfixPostmaster = $sock->GET_INFO("PostfixPostmaster");
    if (trim($PostfixPostmaster) == null) {
        $PostfixPostmaster = "postmaster";
    }
    if ($double_bounce_sender == null) {
        $double_bounce_sender = "double-bounce";
    }
    if ($address_verify_sender == null) {
        $address_verify_sender = "\$double_bounce_sender";
    }
    if ($twobounce_notice_recipient == null) {
        $twobounce_notice_recipient = "postmaster";
    }
    if ($error_notice_recipient == null) {
        $error_notice_recipient = $PostfixPostmaster;
    }
    if ($delay_notice_recipient == null) {
        $delay_notice_recipient = $PostfixPostmaster;
    }
    if ($empty_address_recipient == null) {
        $empty_address_recipient = $PostfixPostmaster;
    }
    if (is_array($mainTemplates->templates_array)) {
        while (list($template, $nothing) = each($mainTemplates->templates_array)) {
            $array = unserialize(base64_decode($main->GET_BIGDATA($template)));
            if (!is_array($array)) {
                $array = $mainTemplates->templates_array[$template];
            }
            $tp = explode("\n", $array["Body"]);
            $Body = null;
            while (list($a, $line) = each($tp)) {
                if (trim($line) == null) {
                    continue;
                }
                $Body = $Body . $line . "\n";
            }
            $conf = $conf . "\n{$template} = <<EOF\n";
            $conf = $conf . "Charset: {$array["Charset"]}\n";
            $conf = $conf . "From:  {$array["From"]}\n";
            $conf = $conf . "Subject: {$array["Subject"]}\n";
            $conf = $conf . "\n";
            $conf = $conf . "{$Body}";
            $conf = $conf . "\n\n";
            $conf = $conf . "EOF\n";
        }
    }
    @file_put_contents("/etc/postfix/bounce.template.cf", $conf);
    $notify_class = unserialize(base64_decode($main->GET_BIGDATA("notify_class")));
    if ($notify_class["notify_class_software"] == 1) {
        $not[] = "software";
    }
    if ($notify_class["notify_class_resource"] == 1) {
        $not[] = "resource";
    }
    if ($notify_class["notify_class_policy"] == 1) {
        $not[] = "policy";
    }
    if ($notify_class["notify_class_delay"] == 1) {
        $not[] = "delay";
    }
    if ($notify_class["notify_class_2bounce"] == 1) {
        $not[] = "2bounce";
    }
    if ($notify_class["notify_class_bounce"] == 1) {
        $not[] = "bounce";
    }
    if ($notify_class["notify_class_protocol"] == 1) {
        $not[] = "protocol";
    }
    postconf("notify_class", @implode(",", $not));
    postconf("double_bounce_sender", "{$double_bounce_sender}");
    postconf("address_verify_sender", "{$address_verify_sender}");
    postconf("2bounce_notice_recipient", $twobounce_notice_recipient);
    postconf("error_notice_recipient", $error_notice_recipient);
    postconf("delay_notice_recipient", $delay_notice_recipient);
    postconf("empty_address_recipient", $empty_address_recipient);
    postconf("bounce_template_file", "/etc/postfix/bounce.template.cf");
}
Esempio n. 20
0
function reconfigure_instance_mime_checks($hostname)
{
    $unix = new unix();
    $users = new usersMenus();
    $postconf = $unix->find_program("postconf");
    $postmulti = $unix->find_program("postmulti");
    if ($users->AMAVIS_INSTALLED) {
        $main = new maincf_multi($hostname);
        $array_filters = unserialize(base64_decode($main->GET_BIGDATA("PluginsEnabled")));
        if ($array_filters["APP_AMAVIS"] == 1) {
            @unlink("/etc/postfix-{$hostname}/mime_header_checks");
            shell_exec("{$postconf} -c \"/etc/postfix-{$hostname}\" -e \"mime_header_checks = \"");
            system("/usr/share/artica-postfix/bin/artica-install --amavis-reload");
            _start_instance($hostname);
            return;
        }
    }
    $sql = "SELECT * FROM smtp_attachments_blocking WHERE ou='{$_GET["ou"]}' AND hostname='{$hostname}' ORDER BY IncludeByName";
    $q = new mysql();
    $results = $q->QUERY_SQL($sql, "artica_backup");
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        if ($ligne["IncludeByName"] == null) {
            continue;
        }
        $f[] = $ligne["IncludeByName"];
    }
    if (!is_array($f)) {
        @unlink("/etc/postfix-{$hostname}/mime_header_checks");
        shell_exec("{$postconf} -c \"/etc/postfix-{$hostname}\" -e \"mime_header_checks = \"");
        _start_instance($hostname);
        return;
    }
    $strings = implode("|", $f);
    echo "Starting......: Postfix \"{$hostname}\" " . count($f) . " extensions blocked\n";
    $pattern[] = "/^\\s*Content-(Disposition|Type).*name\\s*=\\s*\"?(.+\\.({$strings}))\"?\\s*\$/\tREJECT file attachment types is not allowed. File \"\$2\" has the unacceptable extension \"\$3\"";
    $pattern[] = "";
    @file_put_contents("/etc/postfix-{$hostname}/mime_header_checks", implode("\n", $pattern));
    shell_exec("{$postconf} -c \"/etc/postfix-{$hostname}\" -e \"mime_header_checks = regexp:/etc/postfix-{$hostname}/mime_header_checks\"");
}
Esempio n. 21
0
function EnablePOSTFWD2()
{
    $main = new maincf_multi($_GET["instance"]);
    $array_filters = unserialize(base64_decode($main->GET_BIGDATA("PluginsEnabled")));
    $array_filters["APP_POSTFWD2"] = $_GET["EnablePOSTFWD2"];
    $main->SET_BIGDATA("PluginsEnabled", base64_encode(serialize($array_filters)));
    $sock = new sockets();
    $sock->getFrameWork("cmd.php?postfwd2-restart={$_GET["instance"]}");
}
Esempio n. 22
0
function MultiplesInstances_status()
{
    $unix = new unix();
    $users = new usersMenus();
    $sock = new sockets();
    if (!$users->MILTERGREYLIST_INSTALLED) {
        if ($GLOBALS["DEBUG"]) {
            echo __FUNCTION__ . " NoT installed\n";
        }
        return null;
    }
    $main = new maincf_multi($GLOBALS["hostname"], $GLOBALS["ou"]);
    $array_filters = unserialize(base64_decode($main->GET_BIGDATA("PluginsEnabled")));
    $enabled = $array_filters["APP_MILTERGREYLIST"];
    $pid_path = "/var/spool/postfix/var/run/milter-greylist/{$GLOBALS["hostname"]}/greylist.pid";
    if ($GLOBALS["DEBUG"]) {
        echo __FUNCTION__ . "{$GLOBALS["hostname"]} ({$GLOBALS["ou"]}) -> enabled={$enabled}\n";
    }
    $master_pid = trim(@file_get_contents($pid_path));
    if ($GLOBALS["DEBUG"]) {
        echo __FUNCTION__ . "master_pid={$master_pid}\n";
    }
    $l[] = "[MILTER_GREYLIST]";
    $l[] = "service_name=APP_MILTERGREYLIST";
    $l[] = "master_version=" . GetVersionOf("milter-greylist");
    $l[] = "service_cmd=mgreylist";
    $l[] = "service_disabled={$enabled}";
    $l[] = "pid_path={$pid_path}";
    $l[] = "remove_cmd=--milter-grelist-remove";
    if (!$unix->process_exists($master_pid)) {
        $l[] = "running=0";
        $l[] = "";
        echo implode("\n", $l);
        exit;
    }
    $l[] = "running=1";
    $l[] = GetMemoriesOf($master_pid);
    $l[] = "";
    if ($GLOBALS["DEBUG"]) {
        echo __FUNCTION__ . "FINISH\n";
    }
    echo implode("\n", $l);
}
Esempio n. 23
0
function StatusInstance($instance)
{
    if ($GLOBALS["VERBOSE"]) {
        echo "StatusInstance({$instance})\n";
    }
    if (!isset($GLOBALS["postfwd2_instances"])) {
        checksConfigs();
    }
    if (!isset($GLOBALS["CLASS_USERS"])) {
        $GLOBALS["CLASS_USERS"] = new usersMenus();
    }
    if (!isset($GLOBALS["CLASS_SOCKETS"])) {
        $GLOBALS["CLASS_SOCKETS"] = new sockets();
    }
    if (!isset($GLOBALS["CLASS_UNIX"])) {
        $GLOBALS["CLASS_UNIX"] = new unix();
    }
    $main = new maincf_multi($instance);
    $array_filters = unserialize(base64_decode($main->GET_BIGDATA("PluginsEnabled")));
    $ENABLE_POSTFWD2 = $array_filters["APP_POSTFWD2"];
    if ($GLOBALS["VERBOSE"]) {
        echo "ENABLE_POSTFWD2={$ENABLE_POSTFWD2}\n";
    }
    if (!is_numeric($ENABLE_POSTFWD2)) {
        $ENABLE_POSTFWD2 = 0;
    }
    $pid_path = "/var/run/postfwd2/{$instance}.pid";
    $master_pid = trim(@file_get_contents($pid_path));
    if ($GLOBALS["VERBOSE"]) {
        echo "{$pid_path}={$master_pid}\n";
    }
    $version = postfwd2_version();
    if ($GLOBALS["VERBOSE"]) {
        echo "version={$version}\n";
    }
    $l[] = "[APP_POSTFWD2:{$instance}]";
    $l[] = "service_name=APP_POSTFWD2";
    $l[] = "master_version={$version}";
    $l[] = "service_cmd=postfwd2";
    $l[] = "service_disabled={$ENABLE_POSTFWD2}";
    $l[] = "pid_path={$pid_path}";
    $l[] = "watchdog_features=1";
    $l[] = "family=system";
    if ($ENABLE_POSTFWD2 == 0) {
        if ($GLOBALS["VERBOSE"]) {
            echo "Disabled....\n";
        }
        $l[] = "";
        echo implode("\n", $l);
        return;
    }
    if (!$GLOBALS["CLASS_UNIX"]->process_exists($master_pid)) {
        if ($GLOBALS["VERBOSE"]) {
            echo "{$master_pid} not running watchdog ?\n";
        }
        $unix = new unix();
        if (!$GLOBALS["NOWATCHDOG"]) {
            shell_exec($GLOBALS["CLASS_UNIX"]->LOCATE_PHP5_BIN() . " /usr/share/artica-postfix/exec.status.php --watchdog-service APP_POSTFWD2 postfwd2 &");
        }
        $l[] = "";
        echo implode("\n", $l);
        return;
    } else {
        if ($GLOBALS["VERBOSE"]) {
            echo "Pid: {$master_pid} RUNNING\n";
        }
    }
    if ($GLOBALS["VERBOSE"]) {
        echo "unix->GetMemoriesOf({$master_pid})\n";
    }
    $l[] = $GLOBALS["CLASS_UNIX"]->GetMemoriesOf($master_pid);
    $l[] = "";
    echo implode("\n", $l) . "\n";
    return;
}
function postfix_network_table()
{
    $sock = new sockets();
    $PostfixMultiTrustAllInstances = $sock->GET_INFO("PostfixMultiTrustAllInstances");
    $PostfixMultiCreateBubble = $sock->GET_INFO("PostfixMultiCreateBubble");
    if (!is_numeric($PostfixMultiCreateBubble)) {
        $PostfixMultiCreateBubble = 0;
    }
    if (!is_numeric($PostfixMultiTrustAllInstances)) {
        $PostfixMultiTrustAllInstances = 0;
    }
    if ($PostfixMultiCreateBubble == 1) {
        postfix_network_bubble();
        return;
    }
    $q = new mysql();
    $main = new maincf_multi($_GET["hostname"], $_GET["ou"]);
    $nets = unserialize($main->GET_BIGDATA("mynetworks"));
    $sock = new sockets();
    if ($PostfixMultiTrustAllInstances == 1) {
        $MULTINETS = $main->MULTINETS();
    }
    $html = "<center>\n<table cellspacing='0' cellpadding='0' border='0' class='tableView' style='width:100%'>\n<thead class='thead'>\n\t<tr>\n\t<th colspan=4>{networks}</th>\n\t</tr>\n</thead>\n<tbody class='tbody'>";
    if (is_array($nets)) {
        while (list($num, $val) = each($nets)) {
            if (trim($val) == null) {
                continue;
            }
            if ($classtr == "oddRow") {
                $classtr = null;
            } else {
                $classtr = "oddRow";
            }
            $sql = "SELECT netinfos FROM networks_infos WHERE ipaddr='{$val}'";
            $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
            $ligne["netinfos"] = htmlspecialchars($ligne["netinfos"]);
            $ligne["netinfos"] = nl2br($ligne["netinfos"]);
            if ($ligne["netinfos"] == null) {
                $ligne["netinfos"] = "{no_info}";
            }
            $html = $html . "\n\t\t\t\t<tr class={$classtr}>\n\t\t\t\t\t<td width=1%><img src='img/folder-network-32.png'></td>\n\t\t\t\t\t<td style='font-size:16px'>{$val}</td>\n\t\t\t\t\t<td style='font-size:16px'><a href=\"javascript:blur();\" OnClick=\"javascript:GlobalSystemNetInfos('{$val}')\" style='font-size:12px;text-decoration:underline'><i>{$ligne["netinfos"]}</i></a></td>\n\t\t\t\t\t<td  width=1%>" . imgtootltip('delete-32.png', '{delete} {network}', "PostFixDeleteMyNetwork({$num})") . "</td>\n\t\t\t\t</tr>";
        }
    }
    if (is_array($MULTINETS)) {
        while (list($num, $ligne) = each($MULTINETS)) {
            if (trim($num) == null) {
                continue;
            }
            if ($classtr == "oddRow") {
                $classtr = null;
            } else {
                $classtr = "oddRow";
            }
            $html = $html . "\n\t\t\t\t<tr class={$classtr}>\n\t\t\t\t\t<td width=1%><img src='img/folder-network-32.png'></td>\n\t\t\t\t\t<td style='font-size:16px;color:#676767'>{$num} ({trusted})</td>\n\t\t\t\t\t<td style='font-size:16px'>&nbsp;</td>\n\t\t\t\t\t<td  width=1%>&nbsp;</td>\n\t\t\t\t</tr>";
        }
    }
    $html = $html . "\n\t</tbody>\n\t</table>\n\t</center>";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 25
0
function LoadLDAPDBs(){
	$main=new maincf_multi("master","master");
	$databases_list=unserialize(base64_decode($main->GET_BIGDATA("ActiveDirectoryDBS")));	
	if(is_array($databases_list)){
		while (list ($dbindex, $array) = each ($databases_list) ){
			if($array["enabled"]<>1){continue;}
			if($array["resolv_domains"]==1){$domains=$main->buidLdapDBDomains($array);}
			$GLOBALS["LDAPDBS"][$array["database_type"]][]="ldap:$targeted_file";
		}	
	}
}
Esempio n. 26
0
function smtp_instance_edit(){
		
	$page=CurrentPageName();
	$tpl=new templates();		
	$uuid=$_GET["smtp-instance-edit"];
	$main=new maincf_multi($_GET["hostname"],$_GET["ou"]);	
	$array=unserialize(base64_decode($main->GET_BIGDATA("domain_throttle_daemons_list")));
	$conf=$array[$uuid];
	
	if($conf["transport_destination_concurrency_failed_cohort_limit"]==null){$conf["transport_destination_concurrency_failed_cohort_limit"]=1;}
	if($conf["transport_delivery_slot_loan"]==null){$conf["transport_delivery_slot_loan"]=3;}
	if($conf["transport_delivery_slot_discount"]==null){$conf["transport_delivery_slot_discount"]=50;}
	if($conf["transport_delivery_slot_cost"]==null){$conf["transport_delivery_slot_cost"]=5;}
	if($conf["transport_extra_recipient_limit"]==null){$conf["transport_extra_recipient_limit"]=1000;}
	if($conf["transport_initial_destination_concurrency"]==null){$conf["transport_initial_destination_concurrency"]=5;}
	if($conf["transport_destination_recipient_limit"]==null){$conf["transport_destination_recipient_limit"]=50;}
	if($conf["transport_destination_rate_delay"]==null){$conf["transport_destination_rate_delay"]="0s";}
	if($conf["transport_destination_concurrency_positive_feedback"]==null){$conf["transport_destination_concurrency_positive_feedback"]="1/5";}
	if($conf["transport_destination_concurrency_negative_feedback"]==null){$conf["transport_destination_concurrency_negative_feedback"]="1/5";}
	if(!is_numeric($conf["default_process_limit"])){$conf["default_process_limit"]=100;}
	

	$html="
	<div class=explain>{domain_throttle_explain_edit}</div>
	<div id='id-$uuid'>
	<table class=form>
	<tr>
		<td class=legend>{smtp_daemon_name}:<td>
		<td>". Field_text("INSTANCE_NAME",$conf["INSTANCE_NAME"],"width:160px;font-size:13px")."</td>
		<td>&nbsp;</td>
	</tr>
	<tr>
		<td class=legend>{default_process_limit}:<td>
		<td>". Field_text("default_process_limit",$conf["default_process_limit"],"width:60px;font-size:13px")."</td>
		<td>". help_icon("{default_process_limit_text}")."</td>
	</tr>	

	<tr>
		<td class=legend>{enabled}:<td>
		<td>". Field_checkbox("ENABLED",1,$conf["ENABLED"],"CheckEnabledInstance()")."</td>
		<td>&nbsp;</td>
	<tr>
	
	<tr>
		<td class=legend>{default_destination_concurrency_limit}:<td>
		<td>". Field_text("transport_destination_concurrency_limit",$conf["transport_destination_concurrency_limit"],"width:60px;font-size:13px")."</td>
		<td width=1%>". help_icon("{default_destination_concurrency_limit_text}")."</td>
	</tr>
	<tr>
		<td class=legend>{default_destination_rate_delay}:<td>
		<td>". Field_text("transport_destination_rate_delay",$conf["transport_destination_rate_delay"],"width:60px;font-size:13px")."</td>
		<td width=1%>". help_icon("{default_destination_rate_delay_text}")."</td>
	</tr>
	
	<tr>
		<td class=legend>{initial_destination_concurrency}:<td>
		<td>". Field_text("transport_initial_destination_concurrency",$conf["transport_initial_destination_concurrency"],"width:60px;font-size:13px")."</td>
		<td width=1%>". help_icon("{initial_destination_concurrency_text}")."</td>		
	</tr>	
	
	<tr>
		<td class=legend>{default_destination_concurrency_failed_cohort_limit}:<td>
		<td>". Field_text("transport_destination_concurrency_failed_cohort_limit",$conf["transport_destination_concurrency_failed_cohort_limit"],"width:60px;font-size:13px")."</td>
		<td width=1%>". help_icon("{default_destination_concurrency_failed_cohort_limit_text}")."</td>		
	</tr>
	<tr>
		<td class=legend>{default_destination_concurrency_positive_feedback}:<td>
		<td>". Field_text("transport_destination_concurrency_positive_feedback",$conf["transport_destination_concurrency_positive_feedback"],"width:60px;font-size:13px")."</td>
		<td width=1%>". help_icon("{default_destination_concurrency_positive_feedback_text}")."</td>		
	</tr>	
	<tr>
		<td class=legend>{default_destination_concurrency_negative_feedback}:<td>
		<td>". Field_text("transport_destination_concurrency_negative_feedback",$conf["transport_destination_concurrency_negative_feedback"],"width:60px;font-size:13px")."</td>
		<td width=1%>". help_icon("{default_destination_concurrency_negative_feedback_text}")."</td>		
	</tr>		
	<tr>
		<td class=legend>{default_destination_recipient_limit}:<td>
		<td>". Field_text("transport_destination_recipient_limit",$conf["transport_destination_recipient_limit"],"width:60px;font-size:13px")."</td>
		<td width=1%>". help_icon("{default_destination_recipient_limit_text}")."</td>		
	</tr>		
	
	<tr>
		<td class=legend>{default_extra_recipient_limit}:<td>
		<td>". Field_text("transport_extra_recipient_limit",$conf["transport_extra_recipient_limit"],"width:60px;font-size:13px")."</td>
		<td width=1%>". help_icon("{default_extra_recipient_limit_text}")."</td>		
	</tr>	

	<tr>
		<td class=legend>{default_delivery_slot_loan}:<td>
		<td>". Field_text("transport_delivery_slot_loan",$conf["transport_delivery_slot_loan"],"width:60px;font-size:13px")."</td>
		<td width=1%>". help_icon("{default_delivery_slot_loan_text}")."</td>
	</tr>	
		
	<tr>
		<td class=legend>{default_delivery_slot_cost}:<td>
		<td>". Field_text("transport_delivery_slot_cost",$conf["transport_delivery_slot_cost"],"width:60px;font-size:13px")."</td>
		<td width=1%>". help_icon("{default_delivery_slot_cost_text}")."</td>
	</tr>		
	
	<tr>
		<td class=legend>{default_delivery_slot_discount}:<td>
		<td>". Field_text("transport_delivery_slot_discount",$conf["transport_delivery_slot_discount"],"width:60px;font-size:13px")."</td>
		<td width=1%>". help_icon("{default_delivery_slot_discount_text}")."</td>
	</tr>	
	
	<tr>
		<td colspan=3 align=right><hr>". button("{apply}","SaveSMTPInstanceParams()")."</td>
	</tr>
	
	</table>
	</div>
	<script>
		function CheckEnabledInstance(){
			DisableFieldsFromId('id-$uuid');
			document.getElementById('ENABLED').disabled=false;
			document.getElementById('INSTANCE_NAME').disabled=false;
			if(!document.getElementById('ENABLED').checked){return;}
			EnableFieldsFromId('id-$uuid');
		}
	
	
		var x_SaveSMTPInstanceParams= function (obj) {
			var tempvalue=obj.responseText;
			if(tempvalue.length>0){alert(tempvalue)};
			RefreshTab('main_ecluse_config');
			YahooWin4Hide();
			
		}	
		
		function SaveSMTPInstanceParams(){
			var XHR = XHRParseElements('id-$uuid');
			XHR.appendData('ou','{$_GET["ou"]}');
			XHR.appendData('hostname','{$_GET["hostname"]}');
			XHR.appendData('smtp-instance-save','$uuid');
			document.getElementById('id-$uuid').innerHTML=\"<center style='margin:10px'><img src='img/wait_verybig.gif'></center>\";
			XHR.sendAndLoad(\"$page\", 'GET',x_SaveSMTPInstanceParams);
		}	
	CheckEnabledInstance();
	</script>	
	
	";
	echo $tpl->_ENGINE_parse_body($html);
	
}
Esempio n. 27
0
function security_postfix(){
	$hostname=$_GET["hostname"];
	$user=new usersMenus();
	$user->LoadModulesEnabled();
	$md=md5($hostname);
	$tpl=new templates();
	$sock=new sockets();
	$page=CurrentPageName();	
	$q=new mysql();
	$main=new maincf_multi($hostname);
	$ou=$main->ou;
	$ou_encoded=base64_encode($ou);
	$spamass=new spamassassin();
	$EnablePostfixMultiInstance=$sock->GET_INFO("EnablePostfixMultiInstance");
	$SpamassassinMaxRCPTScore=$sock->GET_INFO("SpamassassinMaxRCPTScore");
	
	if($hostname=="master"){
		$message_size_limit=$sock->GET_INFO("message_size_limit");
		$max_rcpt_to=$main->GET("max_rcpt_to");
			
	}
	$stylea="style='font-size:13px;text-decoration:underline;font-weight:bold'";
	$GLOBALS["STYLEA"]=$stylea;
	
	
	if(!is_numeric($SpamassassinMaxRCPTScore)){$SpamassassinMaxRCPTScore=10;}
	if(!is_numeric($message_size_limit)){$message_size_limit=10240000;}
	if($message_size_limit==0){$message_size_limit="{unlimited}";}else{
		$message_size_limit=FormatBytes($message_size_limit/1024);
	}
	
	$js_messagelimit="Loadjs('postfix.messages.restriction.php?script=yes');";
	
	
	if(!is_numeric($max_rcpt_to)){$max_rcpt_to=0;}
	if($max_rcpt_to==0){$max_rcpt_to="{unlimited}";}
	
	//regex
	$data=unserialize(base64_decode($main->GET_BIGDATA("header_check")));
	$header_content_filters_rules=0;
	if(is_array($data)){while (list ($num, $ligne) = each ($data)){if($ligne==null){continue;}$header_content_filters_rules++;}}
	if($header_content_filters_rules==0){$header_content_filters_rules="{no_rules}";}else{$header_content_filters_rules="$header_content_filters_rules&nbsp;{rules}";}
	
	
	$check_client_access=0;
	$data=unserialize(base64_decode($main->GET_BIGDATA("check_client_access")));
	if(is_array($data)){while (list ($num, $ligne) = each ($data)){if($ligne==null){continue;}$check_client_access++;}}
	if($check_client_access==0){$check_client_access="{no_rules}";}else{$check_client_access="$check_client_access&nbsp;{rules}";}
		
	
	$EnableBodyChecks=$main->GET("EnableBodyChecks");
	if(!is_numeric($EnableBodyChecks)){$EnableBodyChecks=0;}
	$EnableBodyChecks_text="{disabled}";
	if($EnableBodyChecks==1){$EnableBodyChecks_text="{enabled}";}
	$sql="SELECT COUNT(*) as tcount FROM postfix_regex_words WHERE `hostname`='{$_GET["hostname"]}' AND enabled=1";
	$ligne=mysql_fetch_array($q->QUERY_SQL($sql,"artica_backup"));
	if($ligne["tcount"]==0){$EnableBodyChecks_rules="{no_rules}";}else{$EnableBodyChecks_rules="{$ligne["tcount"]}&nbsp;{rules}";}
	
	$js_iptables="Loadjs('postfix.iptables.php');";
	$js_regex="Loadjs('domains.postfix.multi.regex.php?ou=$ou&hostname=$hostname');";
	
	$EnablePostfixAutoBlock=$sock->GET_INFO("EnablePostfixAutoBlock");
	if(!is_numeric($EnablePostfixAutoBlock)){$EnablePostfixAutoBlock=0;}
	$EnablePostfixAutoBlock_text="{disabled}";
	if($EnablePostfixAutoBlock==1){$EnablePostfixAutoBlock_text="{enabled}";}	
	$sql="SELECT COUNT(*) AS tcount FROM iptables WHERE local_port=25 AND flux='INPUT' AND disable=0";
	$ligne=mysql_fetch_array($q->QUERY_SQL($sql,"artica_backup"));
	if($ligne["tcount"]==0){$PostfixAutoBlock_rules="{no_rules}";}else{$PostfixAutoBlock_rules="{$ligne["tcount"]}&nbsp;{rules}";}	
	
	
	$smtpd_client_restrictions_js="Loadjs('postfix.smtpd_client_restrictions.php');";
	$EnablePostfixAntispamPack_value=$sock->GET_INFO('EnablePostfixAntispamPack');	
	$EnableGenericrDNSClients=$sock->GET_INFO("EnableGenericrDNSClients");
	$reject_forged_mails=$sock->GET_INFO('reject_forged_mails');	
	$PostfixHideClientMua=$sock->GET_INFO("PostfixHideClientMua");
	$PostfixHideClientMua_js="Loadjs('postfix.hide.headers.php')";
	
	$EnablePostfixInternalDomainsCheck=$sock->GET_INFO('EnablePostfixInternalDomainsCheck');
	$RestrictToInternalDomains=$sock->GET_INFO('RestrictToInternalDomains');
	
	$reject_unknown_client_hostname=$sock->GET_INFO('reject_unknown_client_hostname');
	$reject_unknown_reverse_client_hostname=$sock->GET_INFO('reject_unknown_reverse_client_hostname');
	$reject_unknown_sender_domain=$sock->GET_INFO('reject_unknown_sender_domain');
	$reject_invalid_hostname=$sock->GET_INFO('reject_invalid_hostname');
	$reject_non_fqdn_sender=$sock->GET_INFO('reject_non_fqdn_sender');
	
	if($reject_unknown_client_hostname==1){$reject_unknown_client_hostname="{enabled}";}else{$reject_unknown_client_hostname="{disabled}";}
	if($reject_unknown_reverse_client_hostname==1){$reject_unknown_reverse_client_hostname="{enabled}";}else{$reject_unknown_reverse_client_hostname="{disabled}";}
	if($reject_unknown_sender_domain==1){$reject_unknown_sender_domain="{enabled}";}else{$reject_unknown_sender_domain="{disabled}";}
	if($reject_invalid_hostname==1){$reject_invalid_hostname="{enabled}";}else{$reject_invalid_hostname="{disabled}";}
	if($reject_non_fqdn_sender==1){$reject_non_fqdn_sender="{enabled}";}else{$reject_non_fqdn_sender="{disabled}";}
	if($RestrictToInternalDomains==1){$RestrictToInternalDomains="{enabled}";}else{$RestrictToInternalDomains="{disabled}";}
	if($PostfixHideClientMua==1){$PostfixHideClientMua="{enabled}";}else{$PostfixHideClientMua="{disabled}";}
	
	
	
	
	//Postscreen ------------------------------------------------------------------------------------
	$postscreen_js="Loadjs('postscreen.php?hostname=$hostname&ou=$ou');";
	$EnablePostScreen=$main->GET("EnablePostScreen");
	if(!$user->POSTSCREEN_INSTALLED){$EnablePostScreen=0;}
	$postscreen_dnsbl_action=$main->GET("postscreen_dnsbl_action");
	if($EnablePostScreen==1){$EnablePostScreen="{enabled}";$postscreen_dnsbl_action="$postscreen_dnsbl_action";}else{$EnablePostScreen="{disabled}";$postscreen_dnsbl_action="{disabled}";}
	$data=unserialize(base64_decode($main->GET_BIGDATA("postscreen_dnsbl_sites")));
	$postscreen_dnsbl_count=0;
	while (list ($num, $ligne) = each ($data)){if($ligne==null){continue;}$postscreen_dnsbl_count++;}
	if($postscreen_dnsbl_count==0){$postscreen_dnsbl_count="{no_rules}";}else{$postscreen_dnsbl_count="$postscreen_dnsbl_count&nbsp;{rules}";}
	
	
	//milter-greylist {gl_YES-QUICK} ------------------------------------------------------------------------------------
	$mgreylist_js="Loadjs('milter.greylist.index.php?js=yes');";
	$mgreylist=new milter_greylist(true,$hostname,$ou);
	$MilterGreyListEnabled=$mgreylist->MilterGreyListEnabled;
	if(!$user->MILTERGREYLIST_INSTALLED){$MilterGreyListEnabled=0;}
	$mgreylist_delay="{$mgreylist->main_array["greylist"]}&nbsp;{$mgreylist->main_array["greylist_TIME"]}";
	if($MilterGreyListEnabled==1){$MilterGreyListEnabled="{enabled}&nbsp;$mgreylist_delay";}else{$MilterGreyListEnabled="{disabled}";}

	//Blacklist: ------------------------------------------------------------------------------------
	$Blacklist_js="Loadjs('whitelists.admin.php?js=yes')";
	$sql="SELECT COUNT(*) as tcount FROM postfix_global_blacklist WHERE enabled=1";
	$ligne=mysql_fetch_array($q->QUERY_SQL($sql,"artica_backup"));
	if($ligne["tcount"]==0){$Blacklist_rules="{no_rules}";}else{$Blacklist_rules="{$ligne["tcount"]}&nbsp;{rules}";}
	
	//Attachments ------------------------------------------------------------------------------------
	$enable_attachment_blocking_postfix=$main->GET("enable_attachment_blocking_postfix");
	$attachs_js="Loadjs('domains.edit.attachblocking.ou.php?ou=$ou_encoded&hostname=$hostname');";
	if($EnablePostfixMultiInstance){$hostnameq=" AND hostname='$hostname'";}
	$ou_q=$ou;
	if($hostname=="master"){$ou_q="_Global";}
	$sql="SELECT count(*) as tcount FROM smtp_attachments_blocking WHERE ou='$ou_q'$hostnameq";
	$ligne=mysql_fetch_array($q->QUERY_SQL($sql,"artica_backup"));	
	if($ligne["tcount"]==0){$attachs_rules="{no_rules}";}else{$attachs_rules="{$ligne["tcount"]}&nbsp;{rules}";}
	if($enable_attachment_blocking_postfix==1){$enable_attachment_blocking_postfix="{enabled}";}else{$enable_attachment_blocking_postfix="{disabled}";}	
	
	//Kas3 ------------------------------------------------------------------------------------
	$ou_kas=$ou;
	if($hostname=="master"){$ou_q=base64_encode("default");$ou_kas="default";}
	$kas_js="Loadjs('domains.edit.kas.php?ou=$ou_q');";
	$kas=new kas_mysql($ou_kas);
	$KasxFilterEnabled=$sock->GET_INFO("KasxFilterEnabled");
	$OPT_FILTRATION_ON=$kas->GET_KEY("OPT_FILTRATION_ON");
	$OPT_PROBABLE_SPAM_ON=$kas->GET_KEY("OPT_PROBABLE_SPAM_ON");
	$ACTION_SPAM_MODE=$kas->GET_KEY("ACTION_SPAM_MODE");
	$ACTION_PROBABLE_MODE=$kas->GET_KEY("ACTION_PROBABLE_MODE");	
	if(!$user->kas_installed){$KasxFilterEnabled=0;}
	if($KasxFilterEnabled==0){$OPT_FILTRATION_ON=0;$OPT_PROBABLE_SPAM_ON=0;}
	$OPT_SPAM_RATE_LIMIT=$kas->GET_KEY("OPT_SPAM_RATE_LIMIT");
	$OPT_SPAM_RATE_LIMIT_TABLE=array(4=>"{maximum}",3=>"{high}",2=>"{normal}",1=>"{minimum}");
	if(!is_numeric($OPT_SPAM_RATE_LIMIT)){$OPT_SPAM_RATE_LIMIT=3;}
	if($OPT_FILTRATION_ON==1){$kas_text="{level}:{$OPT_SPAM_RATE_LIMIT_TABLE[$OPT_SPAM_RATE_LIMIT]}";}else{$kas_text="{disabled}";$ACTION_SPAM_MODE=-4;$ACTION_PROBABLE_MODE=-4;}
	if($OPT_PROBABLE_SPAM_ON==1){$kas_probable="{enabled}";}else{$kas_probable="{disabled}";}	
	$kas_action_message=array(0=>"{acceptmessage}",1=>"{kassendcopy}",2=>"{quarantine}",-1=>"{kasreject}",-3=>"{kasdelete}",-4=>"{disabled}");
	$ACTION_SPAM_MODE=$kas_action_message[$ACTION_SPAM_MODE];
	$ACTION_PROBABLE_MODE=$kas_action_message[$ACTION_PROBABLE_MODE];
	
	

	
	//Amavis - spamassassin
	$EnableAmavisDaemon=$user->EnableAmavisDaemon;
	if(!$user->AMAVIS_INSTALLED){$EnableAmavisDaemon=0;}
	$amavis_js="Loadjs('amavis.index.php?ajax=yes');";
	if($EnablePostfixMultiInstance){$hostnameq=" AND hostname='$hostname'";}
	$ou_q=$ou;
	if($hostname=="master"){$ou_q="_Global";}
	$sql="SELECT count(*) as tcount FROM smtp_attachments_blocking WHERE ou='$ou_q'$hostnameq";
	$ligne=mysql_fetch_array($q->QUERY_SQL($sql,"artica_backup"));	
	if($ligne["tcount"]==0){$amavis_attachs_rules="{no_rules}";}else{$amavis_attachs_rules="{$ligne["tcount"]}&nbsp;{rules}";}	
	if($EnableAmavisDaemon==0){$EnableAmavisDaemon_text="{disabled}";}else{$EnableAmavisDaemon_text="{enabled}";}
	
	//Spamassassin - keywords
	$sql="SELECT count(*) as tcount FROM spamassassin_keywords WHERE enabled=1 and score>0";
	$ligne=mysql_fetch_array($q->QUERY_SQL($sql,"artica_backup"));
	if($ligne["tcount"]==0){$spamassassin_keywords="$EnableAmavisDaemon_text&nbsp;{no_rules}";}else{$spamassassin_keywords="$EnableAmavisDaemon_text&nbsp;{$ligne["tcount"]}&nbsp;{rules}";}	
	$spamassassin_keywords_js="Loadjs('spamassassin.keywords.php');";
	
	//spamassassin_backscatter
	$spamassassin_backscatter_js="Loadjs('spamassassin.backscatter.php');";
	$spamassassin_backscatter=$sock->GET_INFO("SpamAssassinVirusBounceEnabled");
	if($EnableAmavisDaemon==0){$spamassassin_backscatter=0;}
	if($spamassassin_backscatter==0){$spamassassin_backscatter="{disabled}";}else{$spamassassin_backscatter="{enabled}";}
	
	$DecodeShortURLs_js="Loadjs('spamassassin.DecodeShortURLs.php');";
	$sql="SELECT COUNT(*) as tcount FROM  spamassassin_table WHERE spam_type='DecodeShortURLs' AND enabled=1";
	$ligne=mysql_fetch_array($q->QUERY_SQL($sql,"artica_backup"));
	if($ligne["tcount"]==0){$DecodeShortURLs="$EnableAmavisDaemon_text&nbsp;{no_rules}";}else{$DecodeShortURLs="$EnableAmavisDaemon_text&nbsp;{$ligne["tcount"]}&nbsp;{rules}";}	
		
	
	//plugins, wrongx, pyzor,razor...
	$spamassassin_js="Loadjs('spamassassin.index.php')";
	$EnableSpamassassinWrongMX=$sock->GET_INFO("EnableSpamassassinWrongMX");
	if(!is_numeric($EnableSpamassassinWrongMX)){$EnableSpamassassinWrongMX=1;}
	if($EnableAmavisDaemon==0){$EnableSpamassassinWrongMX=0;}
	if($EnableSpamassassinWrongMX==0){$EnableSpamassassinWrongMX="{disabled}";}else{$EnableSpamassassinWrongMX="{enabled}";}
	
	$use_razor2=$spamass->main_array["use_razor2"];
	if($EnableAmavisDaemon==0){$use_razor2=0;}
	if($use_razor2==0){$use_razor2="{disabled}";}else{$use_razor2="{enabled}";}
	
	$use_pyzor=$spamass->main_array["use_pyzor"];
	if($EnableAmavisDaemon==0){$use_pyzor=0;}
	if($use_pyzor==0){$use_pyzor="{disabled}";}else{$use_pyzor="{enabled}";}	
	
	$amavis=new amavis();
	$amavis_action1="{pass}";
	$amavis_action2="{pass}";
	$amavis_spam="$EnableAmavisDaemon_text&nbsp;{score} >={$amavis->main_array["BEHAVIORS"]["sa_tag3_level_deflt"]}";
	if($amavis->EnableQuarantineSpammy2==1){$amavis_action1="{quarantine}";}

	$amavis_probable="$EnableAmavisDaemon_text&nbsp;{score} >={$amavis->main_array["BEHAVIORS"]["sa_tag2_level_deflt"]}";
	if($amavis->EnableQuarantineSpammy==1){$amavis_action2="{quarantine}";}
	
	$clamav_unofficial_js="Loadjs('clamav.unofficial.php')";
	
	
	$html="
	<div style='text-align:right'>". imgtootltip("refresh-24.png","{refresh}","RefreshTab('main_config_postfix_synthesis_$md')")."</div>
	<H3 style='font-size:16px'>{APP_POSTFIX} &raquo; {filters_connect}</h3>
	<table style='width:665px' class=form>
		<tr>
			<td class=legend width='350px'>{postfix_autoblock}:</td>
			<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$js_iptables\" $stylea>$EnablePostfixAutoBlock_text&nbsp;$PostfixAutoBlock_rules</a></td>
			<td width=1% nowrap><strong style='font-size:13px'>{firewall}</td>
		</tr>	
		<tr>
			<td class=legend width='350px'>{black list}:</td>
			<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$Blacklist_js\" $stylea>$Blacklist_rules</a></td>
			<td width=1% nowrap><strong style='font-size:13px'>{reject}</td>
		</tr>				
		<tr>
			<td class=legend width='350px'>PostScreen:</td>
			<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$postscreen_js\" $stylea>$EnablePostScreen</a></td>
			<td width=1% nowrap><strong style='font-size:13px'>{reject}</td>
		</tr>		
		<tr>
			<td class=legend width='350px'>PostScreen RBL:</td>
			<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$postscreen_js\" $stylea>$postscreen_dnsbl_action&nbsp;$postscreen_dnsbl_count</a></td>
			<td width=1% nowrap><strong style='font-size:13px'>{reject}</td>
		</tr>			
		<tr>
			<td class=legend width='350px'>{blockips}:</td>
			<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$js_regex\" $stylea>$check_client_access</a></td>
			<td width=1% nowrap><strong style='font-size:13px'>{reject}</td>
		</tr>
		
		<tr>
			<td class=legend width='350px'>{reject_unknown_client_hostname}:</td>
			<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$smtpd_client_restrictions_js\" $stylea>$reject_unknown_client_hostname</a></td>
			<td width=1% nowrap><strong style='font-size:13px'>{reject}</td>
		</tr>
		<tr>
			<td class=legend width='350px'>{reject_unknown_reverse_client_hostname}:</td>
			<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$smtpd_client_restrictions_js\" $stylea>$reject_unknown_reverse_client_hostname</a></td>
			<td width=1% nowrap><strong style='font-size:13px'>{reject}</td>
		</tr>		
		<tr>
			<td class=legend width='350px'>{reject_unknown_sender_domain}:</td>
			<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$smtpd_client_restrictions_js\" $stylea>$reject_unknown_sender_domain</a></td>
			<td width=1% nowrap><strong style='font-size:13px'>{reject}</td>
		</tr>			
		<tr>
			<td class=legend width='350px'>{reject_invalid_hostname}:</td>
			<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$smtpd_client_restrictions_js\" $stylea>$reject_invalid_hostname</a></td>
			<td width=1% nowrap><strong style='font-size:13px'>{reject}</td>
		</tr>		
		<tr>
			<td class=legend width='350px'>{reject_non_fqdn_sender}:</td>
			<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$smtpd_client_restrictions_js\" $stylea>$reject_non_fqdn_sender</a></td>
			<td width=1% nowrap><strong style='font-size:13px'>{reject}</td>
		</tr>	
		<tr>
			<td class=legend width='350px'>{RestrictToInternalDomains}:</td>
			<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$smtpd_client_restrictions_js\" $stylea>$RestrictToInternalDomains</a></td>
			<td width=1% nowrap><strong style='font-size:13px'>{reject}</td>
		</tr>
	</table>
	
	<H3 style='font-size:16px'>{filters_connect}</h3>
	<table style='width:665px' class=form>
		<tr>
			<td class=legend width='350px'>{gl_YES-QUICK}:</td>
			<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$mgreylist_js\" $stylea>$MilterGreyListEnabled</a></td>
			<td width=1% nowrap><strong style='font-size:13px'>{delayed}</td>
		</tr>	
	</table>
	
	<H3 style='font-size:16px'>{APP_POSTFIX} &raquo; {messages_restriction}</h3>
	<table style='width:665px' class=form>
	". _MaxRcptTO($hostname)."
	<tr>
		<td class=legend width='350px'>{message_size_limit}:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$js_messagelimit\" $stylea>$message_size_limit</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>{reject}</td>
	</tr>	
	<tr>
		<td class=legend width='350px'>{HIDE_CLIENT_MUA}:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$PostfixHideClientMua_js\" $stylea>$PostfixHideClientMua</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>{pass}</td>
	</tr>
	
	
	</table>
	<H3 style='font-size:16px'>{APP_POSTFIX} &raquo; {content_filters}</h3>
	<table style='width:665px' class=form>
	<tr>
		<td class=legend width='350px'>{header_content_filters_rules}:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$js_regex\" $stylea>$header_content_filters_rules</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>{reject}</td>
	</tr>	
	<tr>
		<td class=legend width='350px'>{RegexSimpleWords}:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$js_regex\" $stylea>$EnableBodyChecks_text&nbsp;$EnableBodyChecks_rules</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>{reject}</td>
	</tr>	
	<tr>
		<td class=legend width='350px'>{attachment_blocking}:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$attachs_js\" $stylea>$enable_attachment_blocking_postfix&nbsp;$attachs_rules</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>{reject}</td>
	</tr>	
	</table>
	<H3 style='font-size:16px'>{content_filters} &raquo; {APP_KAS3}</h3>
	<table style='width:665px' class=form>
	<tr>
		<td class=legend width='350px'>{APP_KAS3}:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$kas_js\" $stylea>$kas_text</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>&nbsp;</td>
	</tr>	
	<tr>
		<td class=legend width='350px'>{OPT_PROBABLE_SPAM_ON}:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$kas_js\" $stylea>$kas_probable</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>&nbsp;</td>
	</tr>
	<tr>
		<td class=legend width='350px'>{spam option 2}:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$kas_js\" $stylea>$ACTION_PROBABLE_MODE</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>&nbsp;</td>
	</tr>	
	<tr>
		<td class=legend width='350px'>{spam option 1}:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$kas_js\" $stylea>$ACTION_SPAM_MODE</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>&nbsp;</td>
	</tr>		
	
</table>
	<H3 style='font-size:16px'>{content_filters} &raquo; {addons_bundle}</h3>
<table style='width:665px' class=form>
	<tr>
		<td class=legend width='350px'>{attachment_blocking}:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$kas_js\" $stylea>$EnableAmavisDaemon_text&nbsp;$amavis_attachs_rules</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>{quarantine}</td>
	</tr>	
	<tr>
		<td class=legend width='350px'>{block_keywords}:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$spamassassin_keywords_js\" $stylea>$spamassassin_keywords</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>{score}+</td>
	</tr>	
	<tr>
		<td class=legend width='350px'>{Virus_Bounce_Ruleset}:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$spamassassin_backscatter_js\" $stylea>$spamassassin_backscatter</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>{score}+</td>
	</tr>	
	<tr>
		<td class=legend width='350px'>{DecodeShortURLs}:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$DecodeShortURLs_js\" $stylea>$DecodeShortURLs</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>{score}+</td>
	</tr>		
	<tr>
		<td class=legend width='350px'>WrongMX:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$spamassassin_js\" $stylea>$EnableSpamassassinWrongMX</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>{score}+</td>
	</tr>		
	<tr>
		<td class=legend width='350px'>Razor:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$spamassassin_js\" $stylea>$use_razor2</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>{score}+</td>
	</tr>	
	<tr>
		<td class=legend width='350px'>Pyzor:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$spamassassin_js\" $stylea>$use_pyzor</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>{score}+</td>
	</tr>	
	<tr>
		<td class=legend width='350px'>{spam option 2}:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$amavis_js\" $stylea>$amavis_probable</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>$amavis_action2</td>
	</tr>			
	<tr>
		<td class=legend width='350px'>{spam option 1}:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$amavis_js\" $stylea>$amavis_spam</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>$amavis_action1</td>
	</tr>
	<tr>
		<td class=legend width='350px'>{APP_CLAMAV}:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$amavis_js\" $stylea>$EnableAmavisDaemon_text</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>{quarantine}</td>
	</tr>		
	<tr>
		<td class=legend width='350px'>{clamav_unofficial}:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$clamav_unofficial_js\" $stylea>$EnableAmavisDaemon_text</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>{quarantine}</td>
	</tr>			

	

	
</table>	
	
	
	";
	
	echo $tpl->_ENGINE_parse_body($html);
	
}
Esempio n. 28
0
function debug_peer_list_del()
{
    $main = new maincf_multi($_POST["hostname"]);
    $datas = unserialize(base64_decode($main->GET_BIGDATA("debug_peer_list")));
    unset($datas[$_POST["debug_peer_del"]]);
    $newdatas = base64_encode(serialize($datas));
    $main->SET_BIGDATA("debug_peer_list", $newdatas);
    $sock = new sockets();
    $sock->getFrameWork("postfix.php?postfix-debug-peer-list=yes&hostname={$_POST["hostname"]}");
}
Esempio n. 29
0
function dnsbl_delete(){
	$main=new maincf_multi($_GET["hostname"],$_GET["ou"]);
	$array=array();
	$array=unserialize(base64_decode($main->GET_BIGDATA("postscreen_dnsbl_sites")));
	if(!is_array($array)){$array=array();}	
	unset($array[$_GET["dnsbl-delete"]]);
	if(!$main->SET_BIGDATA("postscreen_dnsbl_sites",base64_encode(serialize($array)))){
		writelogs("{$_GET["hostname"]}/{$_GET["ou"]}: error...");
		echo "ERROR";return;
	}	
	$sock=new sockets();
	$sock->getFrameWork("cmd.php?postscreen=yes&hostname={$_GET["hostname"]}");		
}
Esempio n. 30
0
function postfix_regex_rule_delete()
{
    $id = $_GET["PostfixRegexDelete"];
    $main = new maincf_multi($_GET["hostname"], $_GET["ou"]);
    $data = unserialize(base64_decode($main->GET_BIGDATA("header_check")));
    unset($data[$id]);
    if (!is_array($data)) {
        $data = array();
    }
    $main->SET_BIGDATA("header_check", base64_encode(serialize($data)));
    $sock = new sockets();
    if ($_GET["hostname"] == "master") {
        $sock->getFrameWork("cmd.php?headers-check-postfix=yes");
    } else {
        $sock->getFrameWork("cmd.php?postfix-multi-settings={$_GET["hostname"]}");
    }
}