|
@@ -381,13 +381,28 @@ klisted");
|
|
|
* -1 = error
|
|
|
* -2 = the value is blacklisted
|
|
|
|
|
|
+ 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.
|
|
|
+
|
|
|
Example 1.11. secf_check_country usage
|
|
|
...
|
|
|
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 ($? == -2) {
|
|
|
+ xdbg("$rm from $si blocked because Country '$gip2(src=>c
|
|
|
+c)' is blacklisted");
|
|
|
+ exit;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ ...
|
|
|
+
|
|
|
+ if (geoip2_match("$si", "src")) {
|
|
|
+ secf_check_country($gip2(src=>cc));
|
|
|
+ if ($? != 2) {
|
|
|
+ xdbg("$rm from $si blocked because Country '$gip2(src=>c
|
|
|
+c)' is not whitelisted");
|
|
|
exit;
|
|
|
}
|
|
|
}
|