本文整理汇总了PHP中clladp::WhitelistsFromDomain方法的典型用法代码示例。如果您正苦于以下问题:PHP clladp::WhitelistsFromDomain方法的具体用法?PHP clladp::WhitelistsFromDomain怎么用?PHP clladp::WhitelistsFromDomain使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类clladp
的用法示例。
在下文中一共展示了clladp::WhitelistsFromDomain方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: build_allow_xml
function build_allow_xml($ou, $count)
{
if ($count < 10) {
$numero = "0{$count}";
} else {
$numero = $count;
}
$conf[] = "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
$conf[] = "#include <base/group-allow.xml.macro>";
$conf[] = "BEGIN_GROUP_ALLOW_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->WhitelistsFromDomain($val);
while (list($to, $froms) = each($emails)) {
while (list($index, $senders) = each($froms)) {
$conf[] = "EMAIL_ENTRY(\"{$senders}\")";
}
}
}
}
$sql = "SELECT * FROM postfix_global_whitelist WHERE enabled=1 ORDER BY sender";
$q = new mysql();
$results = $q->QUERY_SQL($sql, "artica_backup");
while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
$pattern = trim($ligne["sender"]);
if ($pattern == null) {
continue;
}
$conf[] = "EMAIL_ENTRY(\"{$pattern}\")";
}
$conf[] = "END_GROUP_ALLOW_EMAIL_LIST";
$conf[] = "";
@file_put_contents("/usr/local/ap-mailfilter3/conf/def/group/000000{$numero}-allow.xml", @implode("\n", $conf));
}
示例2: whitelistdom
function whitelistdom($domain = null)
{
$ldap = new clladp();
if ($domain != null) {
$domain = "*";
}
$hash = $ldap->WhitelistsFromDomain($domain);
if ($GLOBALS["VERBOSE"]) {
echo "HASH -> " . count($hash) . " Items\n<br>";
print_r($hash);
}
$data = array();
$data['page'] = 1;
$data['total'] = 0;
$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-32.png", "{delete}", "DeleteWhiteList('{$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);
}
示例3: 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));
}
示例4: whitelistdom
function whitelistdom($domain=null){
$ldap=new clladp();
if($domain<>null){$domain="*";}
$hash=$ldap->WhitelistsFromDomain($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> </th>
</tr>
</thead>
<tbody class='tbody'>";
if(is_array($hash)){
while (list ($from, $line) = each ($hash)){
if($classtr=="oddRow"){$classtr=null;}else{$classtr="oddRow";}
$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)){
$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}',"DeleteWhiteList('$from','$wl');")."</td>
</tr>";}
}}
$html=$html . "</tbody></table>";
$form=$html;
return $form;
}
示例5: report_build_white_from_domain
function report_build_white_from_domain($domain)
{
if ($domain == null) {
return null;
}
$ldap = new clladp();
$hash = $ldap->WhitelistsFromDomain($domain);
if (!is_array($hash)) {
return null;
}
$html = $html . "\n\t\t<hr>\n\t\t<H2 style='font-size:13px'>Accept 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:green'> </div></td>\n\t\t\t\t<td><strong style='font-size:12px'>Bypass filters</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr><td colspan=4><hr></tr>";
}
}
$html = $html . "</table>";
return $html;
}
示例6: whitelistdom
function whitelistdom($domain = null)
{
$ldap = new clladp();
if ($domain != null) {
$domain = "*";
}
$hash = $ldap->WhitelistsFromDomain($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> </td>\n\t\t<td> </td>\n\t\t<td><strong>{recipients}</strong></td>\n\t\t<td><strong>{from}</strong></td>\n\t\t<td> </td>\n\t</tr>";
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)) {
$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}', "DeleteWhiteList('{$from}','{$wl}');") . "</td>\n\t\t\t</tr>";
}
}
}
$html = $html . "</table>";
$form = $html;
return $form;
}
示例7: build_allow_xml
function build_allow_xml($ou, $count)
{
if ($count < 10) {
$numero = "0{$count}";
} else {
$numero = $count;
}
$conf[] = "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
$conf[] = "#include <base/group-allow.xml.macro>";
$conf[] = "BEGIN_GROUP_ALLOW_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->WhitelistsFromDomain($val);
while (list($to, $froms) = each($emails)) {
while (list($index, $senders) = each($froms)) {
$conf[] = "EMAIL_ENTRY(\"{$senders}\")";
}
}
}
}
$conf[] = "END_GROUP_ALLOW_EMAIL_LIST";
$conf[] = "";
@file_put_contents("/usr/local/ap-mailfilter3/conf/def/group/000000{$numero}-allow.xml", @implode("\n", $conf));
}