当前位置: 首页>>代码示例>>PHP>>正文


PHP clladp::BlackListFromDomain方法代码示例

本文整理汇总了PHP中clladp::BlackListFromDomain方法的典型用法代码示例。如果您正苦于以下问题:PHP clladp::BlackListFromDomain方法的具体用法?PHP clladp::BlackListFromDomain怎么用?PHP clladp::BlackListFromDomain使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在clladp的用法示例。


在下文中一共展示了clladp::BlackListFromDomain方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: WhiteListed

function WhiteListed()
{
    $ldap = new clladp();
    $unix = new unix();
    $SPAMASSASSIN_LOCAL_CF = $unix->SPAMASSASSIN_LOCAL_CF();
    $spammassDirectory = dirname($SPAMASSASSIN_LOCAL_CF);
    $assp = array();
    $spamassassin = array();
    $miltergrey = array();
    $blacks = $ldap->BlackListFromDomain();
    if (is_array($blacks)) {
        while (list($to, $array) = each($blacks)) {
            $spamassassin[] = "#rcpt :{$to}";
            while (list($index, $from) = each($array)) {
                if ($from == "*@*") {
                    continue;
                }
                if (preg_match("#(.+?)@(.+)#", $from, $re)) {
                    $first_part = $re[1];
                    $domain = $re[2];
                } else {
                    $first_part = "*";
                    $domain = $from;
                }
                $domain = str_replace("@", "", $domain);
                $spamassassin[] = "blacklist_from\t{$first_part}@{$domain}";
            }
        }
    }
    echo "Starting......: " . date("H:i:s") . " writing whitelist/blacklists for ASSP\n";
    @mkdir("/usr/share/assp/files");
    @mkdir("/usr/local/etc");
    @file_put_contents("/usr/share/assp/files/whiteorg.txt", implode("\n", $assp));
    echo "Starting......: " . date("H:i:s") . " writing whitelist/blacklists for Amavis\n";
    $final = implode("\n", $sender_scores_sitewide);
    $final = $final . "\n";
    @file_put_contents("/usr/local/etc/sender_scores_sitewide", $final);
    @chmod("/usr/local/etc/sender_scores_sitewide", 0644);
    @chown("/usr/local/etc/sender_scores_sitewide", "postfix");
    if (is_file('/usr/local/sbin/amavisd')) {
        if (is_file('/usr/local/etc/amavisd.conf')) {
            if (is_file('/var/spool/postfix/var/run/amavisd-new/amavisd-new.pid')) {
                sys_THREAD_COMMAND_SET('/usr/local/sbin/amavisd -c /usr/local/etc/amavisd.conf -P /var/spool/postfix/var/run/amavisd-new/amavisd-new.pid reload');
            }
        }
    }
    echo "Starting......: " . date("H:i:s") . " writing whitelist/blacklists for spamassassin\n";
    @file_put_contents("{$spammassDirectory}/wbl.cf", implode("\n", $spamassassin));
}
开发者ID:articatech,项目名称:artica,代码行数:49,代码来源:exec.white-black-central.php

示例2: blacklistdom

function blacklistdom($domain = null)
{
    $ldap = new clladp();
    if ($domain != null) {
        $domain = "*";
    }
    $hash = $ldap->BlackListFromDomain($domain);
    $data = array();
    $data['page'] = $page;
    $data['total'] = $total;
    $data['rows'] = array();
    if ($_POST["query"] != null) {
        $search = $_POST["query"];
        $search = str_replace(".", "\\.", $search);
        $search = str_replace("*", ".*?", $search);
    }
    $c = 0;
    if (is_array($hash)) {
        while (list($from, $line) = each($hash)) {
            $recipient_domain = $from;
            if (preg_match("#(.+?)@(.+)#", $recipient_domain, $re)) {
                $recipient_domain = $re[2];
            }
            $ou = $ldap->ou_by_smtp_domain($recipient_domain);
            while (list($num, $wl) = each($line)) {
                if ($search != null) {
                    if (!preg_match("#{$search}#", $wl)) {
                        continue;
                    }
                }
                $c++;
                $id = md5("{$from}{$wl}");
                $delete = imgsimple("delete-24.png", "{delete}", "DeleteBlackList('{$from}','{$wl}','{$id}');");
                $data['rows'][] = array('id' => $id, 'cell' => array("<span style='font-size:14px;color:{$color}'>{$ou}</span>", "<span style='font-size:14px;color:{$color}'>{$wl}</span>", "<span style='font-size:14px;color:{$color}'>{$from}</span>", $delete));
            }
        }
    }
    $data['total'] = $c;
    echo json_encode($data);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:40,代码来源:whitelists.admin.php

示例3: build_deny_xml

function build_deny_xml($ou, $count)
{
    if ($count < 10) {
        $numero = "0{$count}";
    } else {
        $numero = $count;
    }
    $conf[] = "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
    $conf[] = "#include <base/group-deny.xml.macro>";
    $conf[] = "BEGIN_GROUP_DENY_EMAIL_LIST(0x000000{$numero})";
    $ldap = new clladp();
    if ($ldap->ldapFailed) {
        return null;
    }
    $domains = $ldap->hash_get_domains_ou($ou);
    if (is_array($domains)) {
        while (list($num, $val) = each($domains)) {
            $emails = $ldap->BlackListFromDomain($val);
            while (list($to, $froms) = each($emails)) {
                while (list($index, $senders) = each($froms)) {
                    $conf[] = "EMAIL_ENTRY(\"{$senders}\")";
                }
            }
        }
    }
    $conf[] = "END_GROUP_DENY_EMAIL_LIST";
    $conf[] = "";
    @file_put_contents("/usr/local/ap-mailfilter3/conf/def/group/000000{$numero}-deny.xml", @implode("\n", $conf));
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:29,代码来源:exec.kasfilter.php

示例4: WhiteListed

function WhiteListed()
{
    $ldap = new clladp();
    $whites = $ldap->WhitelistsFromDomain();
    $unix = new unix();
    $unix->miltergreylist_cleanconf();
    $SPAMASSASSIN_LOCAL_CF = $unix->SPAMASSASSIN_LOCAL_CF();
    $spammassDirectory = dirname($SPAMASSASSIN_LOCAL_CF);
    $assp = array();
    $spamassassin = array();
    $miltergrey = array();
    if (is_array($whites)) {
        while (list($to, $array) = each($whites)) {
            $spamassassin[] = "#rcpt :{$to}";
            while (list($index, $from) = each($array)) {
                if ($from == "*@*") {
                    continue;
                }
                if (preg_match("#(.+?)@(.+)#", $from, $re)) {
                    $first_part = $re[1];
                    $domain = $re[2];
                } else {
                    $first_part = "*";
                    $domain = $from;
                }
                $s = "{$first_part}@{$domain}";
                $s = str_replace("*@", '', $s);
                $s = str_replace("@*", '', $s);
                $asspwbl_string = "{$first_part}@{$domain}";
                $asspwbl_string = str_replace('.', '\\.', $asspwbl_string);
                $asspwbl_string = str_replace('*', '.*?', $asspwbl_string);
                $assp[] = $asspwbl_string;
                $sender_scores_sitewide[] = "{$s}\t-7.0";
                $spamassassin[] = "whitelist_from\t{$first_part}@{$domain}";
                $unix->miltergreylist_addacl($unix->miltergreylist_buildacl("{$first_part}@{$domain}"));
            }
        }
    }
    $blacks = $ldap->BlackListFromDomain();
    if (is_array($blacks)) {
        while (list($to, $array) = each($blacks)) {
            $spamassassin[] = "#rcpt :{$to}";
            while (list($index, $from) = each($array)) {
                if ($from == "*@*") {
                    continue;
                }
                if (preg_match("#(.+?)@(.+)#", $from, $re)) {
                    $first_part = $re[1];
                    $domain = $re[2];
                } else {
                    $first_part = "*";
                    $domain = $from;
                }
                $spamassassin[] = "blacklist_from\t{$first_part}@{$domain}";
            }
        }
    }
    echo "Starting......: writing whitelist/blacklists for ASSP\n";
    @mkdir("/usr/share/assp/files");
    @mkdir("/usr/local/etc");
    @file_put_contents("/usr/share/assp/files/whiteorg.txt", implode("\n", $assp));
    echo "Starting......: writing whitelist/blacklists for Amavis\n";
    @file_put_contents("/usr/local/etc/sender_scores_sitewide", implode("\n", $sender_scores_sitewide));
    @chmod("/usr/local/etc/sender_scores_sitewide", 0750);
    if (is_file('/usr/local/sbin/amavisd')) {
        if (is_file('/usr/local/etc/amavisd.conf')) {
            if (is_file('/var/spool/postfix/var/run/amavisd-new/amavisd-new.pid')) {
                sys_THREAD_COMMAND_SET('/usr/local/sbin/amavisd -c /usr/local/etc/amavisd.conf -P /var/spool/postfix/var/run/amavisd-new/amavisd-new.pid reload');
            }
        }
    }
    echo "Starting......: writing whitelist/blacklists for spamassassin\n";
    @file_put_contents("{$spammassDirectory}/wbl.cf", implode("\n", $spamassassin));
}
开发者ID:brucewu16899,项目名称:artica,代码行数:74,代码来源:exec.white-black-central.php

示例5: blacklistdom

function blacklistdom($domain=null){
	if($domain==null){$domain="*";}
	$ldap=new clladp();
	$hash=$ldap->BlackListFromDomain($domain);	
	
	
	$html="
	<table cellspacing='0' cellpadding='0' border='0' class='tableView' style='width:100%'>
	<thead class='thead'>
		<tr>
			<th colspan=2>{search}:$domain</th>
			<th>{from}</th>			
			<th>{recipients}</th>
			<th>&nbsp;</th>
		</tr>
	</thead>
	<tbody class='tbody'>";	
	
	
if(is_array($hash)){	
	while (list ($from, $line) = each ($hash)){
		$recipient_domain=$from;
		if(preg_match("#(.+?)@(.+)#",$from,$re)){$recipient_domain=$re[2];}
		$ou=$ldap->ou_by_smtp_domain($recipient_domain);
		while (list ($num, $wl) = each ($line)){
		if($classtr=="oddRow"){$classtr=null;}else{$classtr="oddRow";}
			
			
		$html=$html . 
			"<tr class=$classtr>
				<td width=1%><img src='img/fw_bold.gif'></td>
				<td><strong style='font-size:13px'>$ou</strong></td>
				<td><strong style='font-size:13px'>$wl</strong>
				<td><strong style='font-size:13px'>$from</strong></td>
				<td width=1%>" . imgtootltip('delete-32.png','{delete}',"DeleteBlackList('$from','$wl');")."</td>
			</tr>";}
		
	}}
	
$html=$html . "</table>";

$form=$html;


return $form;

}
开发者ID:rsd,项目名称:artica-1.5,代码行数:47,代码来源:whitelists.admin.php

示例6: report_build_black_from_domain

function report_build_black_from_domain($domain)
{
    if ($domain == null) {
        return null;
    }
    $ldap = new clladp();
    $hash = $ldap->BlackListFromDomain($domain);
    if (!is_array($hash)) {
        return null;
    }
    $html = $html . "\n\t\t<hr>\n\t\t<H2 style='font-size:13px'>Deny email addresses (Global)</h2>\n\t\t<table style='width:100%'>";
    while (list($email, $array) = each($hash)) {
        while (list($num, $match) = each($array)) {
            $html = $html . "\n\t\t\t\t<tr>\n\t\t\t\t<td><strong style='font-size:12px'>From {$match}</td>\n\t\t\t\t<td><strong style='font-size:12px'>To {$email}</td>\n\t\t\t\t<td><div style='width:5px;background-color:#d32d2d'>&nbsp;</div></td>\n\t\t\t\t<td><strong style='font-size:12px'>Deny</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr><td colspan=4><hr></tr>";
        }
    }
    $html = $html . "</table>";
    return $html;
}
开发者ID:articatech,项目名称:artica,代码行数:19,代码来源:exec.whiteblack.php

示例7: blacklistdom

function blacklistdom($domain = null)
{
    if ($domain == null) {
        $domain = "*";
    }
    $ldap = new clladp();
    $hash = $ldap->BlackListFromDomain($domain);
    $html = "<H5>{$domain}</H5>\n\t<table style='width:99%' class=table_form>\n\t<tr style='background-color:#CCCCCC'>\n\t\t<td>&nbsp;</td>\n\t\t<td>&nbsp;</td>\n\t\t<td><strong>{recipients}</strong></td>\n\t\t<td><strong>{from}</strong></td>\n\t\t<td>&nbsp;</td>\n\t</tr>";
    if (is_array($hash)) {
        while (list($from, $line) = each($hash)) {
            $recipient_domain = $from;
            if (preg_match("#(.+?)@(.+)#", $from, $re)) {
                $recipient_domain = $re[2];
            }
            $ou = $ldap->ou_by_smtp_domain($recipient_domain);
            while (list($num, $wl) = each($line)) {
                $html = $html . "<tr " . CellRollOver() . ">\n\t\t\t\t<td width=1%><img src='img/fw_bold.gif'></td>\n\t\t\t\t<td><strong>{$ou}</strong></td>\n\t\t\t\t<td><strong>{$from}</strong></td>\n\t\t\t\t<td><strong>{$wl}</strong>\n\t\t\t\t<td width=1%>" . imgtootltip('x.gif', '{delete}', "DeleteBlackList('{$from}','{$wl}');") . "</td>\n\t\t\t</tr>";
            }
        }
    }
    $html = $html . "</table>";
    $form = $html;
    return $form;
}
开发者ID:brucewu16899,项目名称:artica,代码行数:24,代码来源:whitelists.admin.php


注:本文中的clladp::BlackListFromDomain方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。