aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2023-11-03 17:40:12 +0000
committerGitHub <noreply@github.com>2023-11-03 17:40:12 +0000
commitf5d5be99421097d18824c69148b7dacb608e7b84 (patch)
tree402d2277c3428f52976d508ab843483fee6d8f56
parentf268919adfe3f43814413062078bea000bc0ff02 (diff)
parenteeabb14d927ebbf5aa92da60f55651e0bd143276 (diff)
downloadrspamd-f5d5be99421097d18824c69148b7dacb608e7b84.tar.gz
rspamd-f5d5be99421097d18824c69148b7dacb608e7b84.zip
Merge pull request #4678 from fatalbanana/rbl_exclude_local
[Fix] rbl: unbreak `exclude_local`
-rw-r--r--lualib/plugins/rbl.lua2
-rw-r--r--src/plugins/lua/rbl.lua6
-rw-r--r--test/functional/cases/001_merged/300_rbl.robot1
-rw-r--r--test/functional/configs/merged-override.conf1
4 files changed, 4 insertions, 6 deletions
diff --git a/lualib/plugins/rbl.lua b/lualib/plugins/rbl.lua
index 320fd7725..bf8bd3cfa 100644
--- a/lualib/plugins/rbl.lua
+++ b/lualib/plugins/rbl.lua
@@ -49,7 +49,6 @@ local default_options = {
['default_unknown'] = false,
['default_dkim_domainonly'] = true,
['default_emails_domainonly'] = false,
- ['default_exclude_private_ips'] = true,
['default_exclude_users'] = false,
['default_exclude_local'] = true,
['default_no_ip'] = false,
@@ -91,7 +90,6 @@ local rule_schema_tbl = {
emails_domainonly = ts.boolean:is_optional(),
enabled = ts.boolean:is_optional(),
exclude_local = ts.boolean:is_optional(),
- exclude_private_ips = ts.boolean:is_optional(),
exclude_users = ts.boolean:is_optional(),
from = ts.boolean:is_optional(),
hash = ts.one_of { "sha1", "sha256", "sha384", "sha512", "md5", "blake2" }:is_optional(),
diff --git a/src/plugins/lua/rbl.lua b/src/plugins/lua/rbl.lua
index f2233a3e5..fda7cce16 100644
--- a/src/plugins/lua/rbl.lua
+++ b/src/plugins/lua/rbl.lua
@@ -151,9 +151,7 @@ local function gen_check_rcvd_conditions(rbl, received_total)
end
if ((rh.real_ip:get_version() == 6 and rbl.ipv6) or
(rh.real_ip:get_version() == 4 and rbl.ipv4)) and
- ((rbl.exclude_private_ips and not rh.real_ip:is_local()) or
- not rbl.exclude_private_ips) and ((rbl.exclude_local_ips and
- not is_excluded_ip(rh.real_ip)) or not rbl.exclude_local_ips) then
+ ((rbl.exclude_local and not rh.real_ip:is_local() or is_excluded_ip(rh.real_ip)) or not rbl.exclude_local) then
return true
else
return false
@@ -845,7 +843,7 @@ local function gen_rbl_callback(rule)
description[#description + 1] = 'user'
end
- if rule.exclude_local or rule.exclude_private_ips then
+ if rule.exclude_local then
pipeline[#pipeline + 1] = check_local
description[#description + 1] = 'local'
end
diff --git a/test/functional/cases/001_merged/300_rbl.robot b/test/functional/cases/001_merged/300_rbl.robot
index 61c02c26b..8b19fae06 100644
--- a/test/functional/cases/001_merged/300_rbl.robot
+++ b/test/functional/cases/001_merged/300_rbl.robot
@@ -93,5 +93,6 @@ NUMERIC URLS WITH CONTENT
NUMERIC URLS WITH EVERYTHING
Scan File ${RSPAMD_TESTDIR}/messages/numeric_urls.eml
+ ... IP=127.0.0.1
... Settings={symbols_enabled = [URIBL_NUMERIC_EVERYTHING]}
Expect Symbol With Exact Options URIBL_NUMERIC_EVERYTHING 12.11.10.9:url 4.3.2.1:url 8.7.6.5:url
diff --git a/test/functional/configs/merged-override.conf b/test/functional/configs/merged-override.conf
index c94d8df00..09ac00584 100644
--- a/test/functional/configs/merged-override.conf
+++ b/test/functional/configs/merged-override.conf
@@ -324,6 +324,7 @@ rbl {
images = true;
content_urls = true;
rbl = "test9.uribl";
+ exclude_local = false;
}
URIBL_NOCONTENT {
rbl = "test9.uribl";