diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-01-22 14:23:02 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-01-22 14:23:02 +0000 |
commit | 199b32be13c152cd501a772d23c25f45605b6cff (patch) | |
tree | 64e10f24a44cc94b7a538f22322ccc1d1c68f0d0 /conf/lua | |
parent | 253eeb9b99fe588e3ed1ef08ec2343e4ee821653 (diff) | |
download | rspamd-199b32be13c152cd501a772d23c25f45605b6cff.tar.gz rspamd-199b32be13c152cd501a772d23c25f45605b6cff.zip |
Improve hostname processing.
Diffstat (limited to 'conf/lua')
-rw-r--r-- | conf/lua/hfilter.lua | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/conf/lua/hfilter.lua b/conf/lua/hfilter.lua index 967953157..f0c4748a8 100644 --- a/conf/lua/hfilter.lua +++ b/conf/lua/hfilter.lua @@ -134,12 +134,10 @@ local function check_host(task, host, symbol_suffix, eq_ip, eq_host) end if eq_host then eq_host = string.lower(eq_host) - else - eq_host = '' end if check_fqdn(host) then - if eq_host == '' or eq_host ~= host then + if not eq_host or (eq_host ~= 'unknown' or eq_host ~= host) then task:get_resolver():resolve_a(task:get_session(), task:get_mempool(), host, check_host_cb_a) end else @@ -169,9 +167,6 @@ local function hfilter(task) --HOSTNAME-- local hostname = task:get_hostname() - if hostname and ip and hostname == '[' .. ip .. ']' then - hostname = false - end --HELO-- local helo = task:get_helo() @@ -218,8 +213,9 @@ local function hfilter(task) break end end - else - task:insert_result('HFILTER_HOSTNAME_NOPTR', 1.00) + if hostname == 'unknown' then + task:insert_result('HFILTER_HOSTNAME_NOPTR', 1.00) + end end --Insert weight's for HELO or HOSTNAME |