diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2013-12-20 15:50:00 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2013-12-20 15:50:00 +0000 |
commit | 597fd990eed12944a739761aac81f2f26377a7e5 (patch) | |
tree | fcf800f65412e27a56497b370eb283ab6b3c227e /src | |
parent | 42442bfbeabc7cbd2910475a9eca30d1d886b37d (diff) | |
download | rspamd-597fd990eed12944a739761aac81f2f26377a7e5.tar.gz rspamd-597fd990eed12944a739761aac81f2f26377a7e5.zip |
Do not check invalid IP addresses.
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/lua/multimap.lua | 2 | ||||
-rw-r--r-- | src/plugins/lua/rbl.lua | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/lua/multimap.lua b/src/plugins/lua/multimap.lua index 229d594cf..1711c212e 100644 --- a/src/plugins/lua/multimap.lua +++ b/src/plugins/lua/multimap.lua @@ -66,7 +66,7 @@ local function check_multimap(task) end elseif rule['type'] == 'dnsbl' then local ip = task:get_from_ip() - if ip and ip ~= "0.0.0.0" then + if ip and ip:to_string() ~= "0.0.0.0" then if ip:get_version() == 6 and rule['ipv6'] then task:get_resolver():resolve_a(task:get_session(), task:get_mempool(), ip_to_rbl(ip, rule['map']), multimap_rbl_cb, rule['map']) diff --git a/src/plugins/lua/rbl.lua b/src/plugins/lua/rbl.lua index cb827e854..e7e720908 100644 --- a/src/plugins/lua/rbl.lua +++ b/src/plugins/lua/rbl.lua @@ -78,7 +78,7 @@ local function rbl_cb (task) end local rip = task:get_from_ip() - if(rip:to_string() ~= "0.0.0.0") then + if rip and (rip:to_string() ~= '0.0.0.0') then for k,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 @@ -89,7 +89,7 @@ local function rbl_cb (task) end local recvh = task:get_received_headers() for _,rh in ipairs(recvh) do - if rh['real_ip'] then + if rh['real_ip'] and rh['real_ip']:to_string() ~= '0.0.0.0' then for k,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 |