diff options
author | Mike Teplynin <mike@teplynin.com> | 2024-12-13 12:14:01 +0300 |
---|---|---|
committer | Mike Teplynin <mike@teplynin.com> | 2024-12-13 12:14:01 +0300 |
commit | b0cbe7074ad8f6eae254108c4776ff638a09658f (patch) | |
tree | 5ed6bd5263ee0329b58046a47b026eb0e17de245 /src/plugins/lua | |
parent | 887b84d1fa6235d4582d7468a662873e5edefe91 (diff) | |
download | rspamd-b0cbe7074ad8f6eae254108c4776ff638a09658f.tar.gz rspamd-b0cbe7074ad8f6eae254108c4776ff638a09658f.zip |
Skip extra RBL checks when Received IP same as From IP
Diffstat (limited to 'src/plugins/lua')
-rw-r--r-- | src/plugins/lua/rbl.lua | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/plugins/lua/rbl.lua b/src/plugins/lua/rbl.lua index b2ccf8699..8126e9c8f 100644 --- a/src/plugins/lua/rbl.lua +++ b/src/plugins/lua/rbl.lua @@ -689,12 +689,17 @@ local function gen_rbl_callback(rule) local received_total = #received local check_conditions = gen_check_rcvd_conditions(rule, received_total) + local from_ip = task:get_from_ip() for pos, rh in ipairs(received) do if check_conditions(rh, pos) then - add_dns_request(task, rh.real_ip, false, true, - requests_table, 'received', - whitelist) + if rh.real_ip ~= from_ip then + add_dns_request(task, rh.real_ip, false, true, + requests_table, 'received', + whitelist) + else + lua_util.debugm(N, task, 'Received IP same as From IP, skipping extra check') + end end end |