]> source.dussan.org Git - rspamd.git/commitdiff
Fix multimap to handle ipv6 addresses.
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Fri, 20 Apr 2012 16:27:55 +0000 (20:27 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Fri, 20 Apr 2012 16:27:55 +0000 (20:27 +0400)
src/plugins/lua/multimap.lua

index 548cc2ea69cde5ab69909d8e5027458f62fe48d9..fe213b8e69db63e01f941686ad523be2234ba398 100644 (file)
@@ -89,8 +89,11 @@ function check_multimap(task)
                        local ip = task:get_from_ip()
                        if ip then
                                local _,_,o1,o2,o3,o4 = string.find(ip, '(%d+)%.(%d+)%.(%d+)%.(%d+)')
-                               local rbl_str = o4 .. '.' .. o3 .. '.' .. o2 .. '.' .. o1 .. '.' .. rule['map']
-                               task:resolve_dns_a(rbl_str, 'multimap_rbl_cb')
+                               if r then
+                                       -- TODO: cannot handle ipv6 addresses
+                                       local rbl_str = o4 .. '.' .. o3 .. '.' .. o2 .. '.' .. o1 .. '.' .. rule['map']
+                                       task:resolve_dns_a(rbl_str, 'multimap_rbl_cb')
+                               end
                        end
                elseif rule['type'] == 'rcpt' then
                        -- First try to get rcpt field