From: Alexey Date: Fri, 31 Jan 2014 17:49:50 +0000 (-0800) Subject: Optimize Hfilter X-Git-Tag: 0.7.0~430^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2330c14b922648d36df4dfdc55c4ba03a0b14c12;p=rspamd.git Optimize Hfilter --- diff --git a/conf/lua/hfilter.lua b/conf/lua/hfilter.lua index 3a7f812b1..db940343d 100644 --- a/conf/lua/hfilter.lua +++ b/conf/lua/hfilter.lua @@ -207,15 +207,16 @@ local function hfilter(task) local weight_hostname = 0 if hostname then -- Check regexp HOSTNAME - for regexp,weight in pairs(checks_hellohost) do - if check_regexp(hostname, regexp) then - weight_hostname = weight - break + if hostname == 'unknown' then + task:insert_result('HFILTER_HOSTNAME_NOPTR', 1.00) + else + for regexp,weight in pairs(checks_hellohost) do + if check_regexp(hostname, regexp) then + weight_hostname = weight + break + end end end - if hostname == 'unknown' then - task:insert_result('HFILTER_HOSTNAME_NOPTR', 1.00) - end end --Insert weight's for HELO or HOSTNAME