From 4ce366470467ef4052c171f02bf5e6fa6e1a5c57 Mon Sep 17 00:00:00 2001 From: Alexey AL Date: Thu, 12 Feb 2015 20:45:28 +0300 Subject: [PATCH] Fix helo checks in rbl.lua --- src/plugins/lua/rbl.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/lua/rbl.lua b/src/plugins/lua/rbl.lua index f89055f26..9abac0067 100644 --- a/src/plugins/lua/rbl.lua +++ b/src/plugins/lua/rbl.lua @@ -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 -- 2.39.5