浏览代码

secfilter: Documentation updated regarding country filtering [skip ci]

pepelux 3 周之前
父节点
当前提交
02c60ed584
共有 1 个文件被更改,包括 15 次插入2 次删除
  1. 15 2
      src/modules/secfilter/doc/secfilter_admin.xml

+ 15 - 2
src/modules/secfilter/doc/secfilter_admin.xml

@@ -350,16 +350,29 @@
 		<listitem>-2 = the value is blacklisted</listitem>
 		</itemizedlist>
  		</para>
+ 		<para>
+ 		You can filter by blocking the IPs of messages coming from countries that are on the blacklist. Alternatively, you can block everything that is not explicitly on the whitelist.
+ 		</para>
 
        <example>
          <title><function>secf_check_country</function> usage</title>
 
          <programlisting format="linespecific">
 		...
+	if (geoip2_match("$si", "src")) {
+                secf_check_country($gip2(src=>cc));
+                if ($? == -2) {
+                        xdbg("$rm from $si blocked because Country '$gip2(src=>cc)' is blacklisted");
+                        exit;
+                }
+        }
+
+		...
+
         if (geoip2_match("$si", "src")) {
                 secf_check_country($gip2(src=>cc));
-                if ($avp(secfilter) == -2) {
-                        xlog("L_ALERT", "$rm from $si blocked because Country '$gip2(src=>cc)' is blacklisted");
+                if ($avp(secfilter) != 2) {
+                        xlog("L_ALERT", "$rm from $si blocked because Country '$gip2(src=>cc)' is not whitelisted");
                         exit;
                 }
         }