From: Mike Teplynin Date: Fri, 13 Dec 2024 09:14:01 +0000 (+0300) Subject: Skip extra RBL checks when Received IP same as From IP X-Git-Tag: 3.11.0~1^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0cbe7074ad8f6eae254108c4776ff638a09658f;p=thirdparty%2Frspamd.git Skip extra RBL checks when Received IP same as From IP --- diff --git a/src/plugins/lua/rbl.lua b/src/plugins/lua/rbl.lua index b2ccf86999..8126e9c8f7 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