本文整理匯總了PHP中maincf_multi::Blacklist_generic方法的典型用法代碼示例。如果您正苦於以下問題:PHP maincf_multi::Blacklist_generic方法的具體用法?PHP maincf_multi::Blacklist_generic怎麽用?PHP maincf_multi::Blacklist_generic使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類maincf_multi
的用法示例。
在下文中一共展示了maincf_multi::Blacklist_generic方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: smtpd_sender_restrictions
function smtpd_sender_restrictions()
{
if (!isset($GLOBALS["CLASS_SOCKET"])) {
$GLOBALS["CLASS_SOCKET"] = new sockets();
$sock = $GLOBALS["CLASS_SOCKET"];
} else {
$sock = $GLOBALS["CLASS_SOCKET"];
}
$main = new maincf_multi("master", "master");
$smtpd_sender_restrictions_black = $main->Blacklist_generic();
if (!is_file("/etc/artica-postfix/settings/Daemons/reject_unknown_sender_domain")) {
@file_put_contents("/etc/artica-postfix/settings/Daemons/reject_unknown_sender_domain", 1);
}
$RestrictToInternalDomains = $sock->GET_INFO("RestrictToInternalDomains");
$EnablePostfixInternalDomainsCheck = $sock->GET_INFO("EnablePostfixInternalDomainsCheck");
$reject_non_fqdn_sender = $sock->GET_INFO('reject_non_fqdn_sender');
$reject_unknown_sender_domain = $sock->GET_INFO('reject_unknown_sender_domain');
$enforce_helo_restrictions = intval($sock->GET_INFO("enforce_helo_restrictions"));
$smtpd_sender_restrictions[] = "permit_mynetworks";
$smtpd_sender_restrictions[] = "permit_sasl_authenticated";
$smtpd_sender_restrictions[] = "check_client_access cidr:/etc/postfix/check_client_access.cidr";
$smtpd_sender_restrictions[] = "check_client_access hash:/etc/postfix/check_client_access";
if ($EnablePostfixInternalDomainsCheck == 1) {
$smtpd_sender_restrictions[] = "reject_unknown_sender_domain";
$reject_unknown_sender_domain = 0;
}
if ($RestrictToInternalDomains == 1) {
BuildAllWhitelistedServer();
BuildAllMyDomains();
$smtpd_sender_restrictions[] = "check_client_access hash:/etc/postfix/all_whitelisted_servers";
$smtpd_sender_restrictions[] = "check_sender_access hash:/etc/postfix/all_internal_domains";
if ($reject_unknown_sender_domain == 1) {
$smtpd_sender_restrictions[] = "reject_unknown_sender_domain";
}
if ($reject_non_fqdn_sender == 1) {
$smtpd_sender_restrictions[] = "reject_non_fqdn_sender";
}
if ($smtpd_sender_restrictions_black != null) {
$smtpd_sender_restrictions[] = $smtpd_sender_restrictions_black;
}
$smtpd_sender_restrictions[] = "reject";
} else {
if ($reject_unknown_sender_domain == 1) {
$smtpd_sender_restrictions[] = "reject_unknown_sender_domain";
}
if ($reject_non_fqdn_sender == 1) {
$smtpd_sender_restrictions[] = "reject_non_fqdn_sender";
}
if ($smtpd_sender_restrictions_black != null) {
$smtpd_sender_restrictions[] = $smtpd_sender_restrictions_black;
}
}
postconf("smtpd_helo_restrictions", null);
if ($enforce_helo_restrictions == 1) {
$enforce_helo_restrictions_final = "permit_mynetworks,permit_sasl_authenticated, check_client_access hash:/etc/postfix/check_client_access, check_client_access cidr:/etc/postfix/check_client_access.cidr,reject_invalid_helo_hostname,reject_unknown_helo_hostname";
postconf("smtpd_helo_required", "yes");
postconf("smtpd_helo_restrictions", $enforce_helo_restrictions_final);
} else {
postconf("smtpd_helo_required", "no");
postconf("smtpd_helo_restrictions", "permit_mynetworks,permit_sasl_authenticated, check_client_access hash:/etc/postfix/check_client_access, check_client_access cidr:/etc/postfix/check_client_access.cidr, permit");
}
if (!isset($smtpd_sender_restrictions)) {
postconf("smtpd_sender_restrictions");
return;
}
if (!is_array($smtpd_sender_restrictions)) {
postconf("smtpd_sender_restrictions");
return;
}
$final = @implode(",", $smtpd_sender_restrictions);
postconf("smtpd_sender_restrictions", $final);
}