]> source.dussan.org Git - rspamd.git/commitdiff
Fix helo checks in rbl.lua
authorAlexey AL <AlexeySa@users.noreply.github.com>
Thu, 12 Feb 2015 17:45:28 +0000 (20:45 +0300)
committerAlexey AL <AlexeySa@users.noreply.github.com>
Thu, 12 Feb 2015 17:45:28 +0000 (20:45 +0300)
src/plugins/lua/rbl.lua

index f89055f2690068ed70f7f7ec826ec229c2e6209a..9abac00677ea1f988effc498c0f9882e2736102d 100644 (file)
@@ -1,6 +1,7 @@
 local rbls = {}
 
 local rspamd_logger = require "rspamd_logger"
+local rspamd_ip = require "rspamd_ip"
 
 local function ip_to_rbl(ip, rbl)
   return table.concat(ip:inversed_str_octets(), ".") .. '.' .. rbl
@@ -82,7 +83,7 @@ local function rbl_cb (task)
          end
          if not havegot['helo'] then
            havegot['helo'] = task:get_helo()
-           if havegot['helo'] == nil or string.sub(havegot['helo'],1,1) == '[' then
+           if not havegot['helo'] or string.sub(havegot['helo'],1,1) == '[' or rspamd_ip.from_string(havegot['helo']):is_valid() then
              notgot['helo'] = true
              return
            end