Browse Source

Merge pull request #4678 from fatalbanana/rbl_exclude_local

[Fix] rbl: unbreak `exclude_local`
tags/3.8.0
Vsevolod Stakhov 6 months ago
parent
commit
f5d5be9942
No account linked to committer's email address

+ 0
- 2
lualib/plugins/rbl.lua View File

@@ -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(),

+ 2
- 4
src/plugins/lua/rbl.lua View File

@@ -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

+ 1
- 0
test/functional/cases/001_merged/300_rbl.robot View File

@@ -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

+ 1
- 0
test/functional/configs/merged-override.conf View File

@@ -324,6 +324,7 @@ rbl {
images = true;
content_urls = true;
rbl = "test9.uribl";
exclude_local = false;
}
URIBL_NOCONTENT {
rbl = "test9.uribl";

Loading…
Cancel
Save