diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-08-05 15:11:03 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-08-05 15:11:03 +0400 |
commit | 5a334d3e1221af39faba74003f3eaa61d74e5b0d (patch) | |
tree | f5927cae2a5c66db91c2db7782ad6d852184b885 /src/plugins/lua | |
parent | f5867bfec49caebbe06b3058fd905dd243f07438 (diff) | |
download | rspamd-5a334d3e1221af39faba74003f3eaa61d74e5b0d.tar.gz rspamd-5a334d3e1221af39faba74003f3eaa61d74e5b0d.zip |
More checks in lua plugins.0.4.2
Diffstat (limited to 'src/plugins/lua')
-rw-r--r-- | src/plugins/lua/once_received.lua | 10 | ||||
-rw-r--r-- | src/plugins/lua/received_rbl.lua | 8 |
2 files changed, 11 insertions, 7 deletions
diff --git a/src/plugins/lua/once_received.lua b/src/plugins/lua/once_received.lua index a7b2a2655..0de235c01 100644 --- a/src/plugins/lua/once_received.lua +++ b/src/plugins/lua/once_received.lua @@ -28,10 +28,12 @@ function check_quantity_received (task) for _,h in ipairs(bad_hosts) do if string.find(hn, h) then -- Check for good hostname - for _,gh in ipairs(good_hosts) do - if string.find(hn, gh) then - i = false - break + if good_hosts then + for _,gh in ipairs(good_hosts) do + if string.find(hn, gh) then + i = false + break + end end end if i then diff --git a/src/plugins/lua/received_rbl.lua b/src/plugins/lua/received_rbl.lua index b0991b392..a2deda259 100644 --- a/src/plugins/lua/received_rbl.lua +++ b/src/plugins/lua/received_rbl.lua @@ -22,9 +22,11 @@ function received_cb (task) for _,rh in ipairs(recvh) do if rh['real_ip'] then local _,_,o1,o2,o3,o4 = string.find(rh['real_ip'], '^(%d+)%.(%d+)%.(%d+)%.(%d+)$') - for _,rbl in ipairs(rbls) do - rbl_str = o4 .. '.' .. o3 .. '.' .. o2 .. '.' .. o1 .. '.' .. rbl['rbl'] - task:resolve_dns_a(rbl_str, 'dns_cb', rbl['symbol']) + if o1 and o2 and o3 and o4 then + for _,rbl in ipairs(rbls) do + rbl_str = o4 .. '.' .. o3 .. '.' .. o2 .. '.' .. o1 .. '.' .. rbl['rbl'] + task:resolve_dns_a(rbl_str, 'dns_cb', rbl['symbol']) + end end end end |