aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/lua/rbl.lua
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2013-11-20 21:02:48 +0200
committerAndrew Lewis <nerf@judo.za.org>2013-11-20 21:02:48 +0200
commit26b07df9e971d99a7c5fb29fdfc41496d3ece690 (patch)
tree3ae3874d056e61e602953ffe14e7df2a011de938 /src/plugins/lua/rbl.lua
parentbca5bd89e600af50301e3ec7a9eae76b7044099e (diff)
downloadrspamd-26b07df9e971d99a7c5fb29fdfc41496d3ece690.tar.gz
rspamd-26b07df9e971d99a7c5fb29fdfc41496d3ece690.zip
Make lookup conditional on RBL preferences
Diffstat (limited to 'src/plugins/lua/rbl.lua')
-rw-r--r--src/plugins/lua/rbl.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/lua/rbl.lua b/src/plugins/lua/rbl.lua
index e0284c354..2a395256f 100644
--- a/src/plugins/lua/rbl.lua
+++ b/src/plugins/lua/rbl.lua
@@ -38,16 +38,22 @@ local function rbl_cb (task)
local rip = task:get_from_ip()
if(rip ~= "0.0.0.0") then
for _,rbl in pairs(rbls) do
+ if (rip:get_version() == "6" and rbl['ipv6'] and rbl['from']) or
+ (rip:get_version() == "4" and rbl['ipv4'] and rbl['from']) then
task:get_resolver():resolve_a(task:get_session(), task:get_mempool(),
ip_to_rbl(rip, rbl['rbl']), rbl_dns_cb, rbl['symbol'])
+ end
end
end
local recvh = task:get_received_headers()
for _,rh in ipairs(recvh) do
if rh['real_ip'] then
for _,rbl in pairs(rbls) do
+ if (rh['real_ip']:get_version() == "6" and rbl['ipv6'] and rbl['received']) or
+ (rh['real_ip']:get_version() == "4" and rbl['ipv4'] and rbl['received']) then
task:get_resolver():resolve_a(task:get_session(), task:get_mempool(),
ip_to_rbl(rh['real_ip'], rbl['rbl']), rbl_dns_cb, rbl['symbol'])
+ end
end
end
end