]> source.dussan.org Git - rspamd.git/commitdiff
Optimize Hfilter 35/head
authorAlexey <AlexeySa@users.noreply.github.com>
Fri, 31 Jan 2014 17:49:50 +0000 (09:49 -0800)
committerAlexey <AlexeySa@users.noreply.github.com>
Fri, 31 Jan 2014 17:49:50 +0000 (09:49 -0800)
conf/lua/hfilter.lua

index 3a7f812b105794bf2110227bf114bb4f742cc749..db940343d3e67aa8dcb2ae9d78a7946b5bcb6c1f 100644 (file)
@@ -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