From 2819c02451d3f713786e993b149a068d58da47ef Mon Sep 17 00:00:00 2001 From: Alexey Date: Fri, 31 Jan 2014 09:49:50 -0800 Subject: [PATCH] Optimize Hfilter --- conf/lua/hfilter.lua | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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 -- 2.39.5