本文整理汇总了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);
}