]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix placement of RDNS checks
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 27 Feb 2016 13:39:14 +0000 (13:39 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 27 Feb 2016 13:39:14 +0000 (13:39 +0000)
src/plugins/lua/once_received.lua

index 0b64bca8cd839b46c922c39d8ffe2607b38f9e31..671ebd98d07a1bcc0c7e838eda2c2307b76a1d76 100644 (file)
@@ -69,23 +69,23 @@ local function check_quantity_received (task)
     end
   end
 
+  local task_ip = task:get_ip()
+
+  -- Here we don't care about received
+  if not task:get_hostname() and task_ip then
+
+    task:get_resolver():resolve_ptr({task = task,
+      name = task_ip:to_string(),
+      callback = recv_dns_cb
+    })
+    return
+  end
+
   local recvh = task:get_received_headers()
   if recvh and #recvh <= 1 then
     local ret = true
     local r = recvh[1]
 
-    local task_ip = task:get_ip()
-
-    -- Here we don't care about received
-    if not task:get_hostname() and task_ip then
-      rspamd_logger.infox(task, 'hui')
-      task:get_resolver():resolve_ptr({task = task,
-        name = task_ip:to_string(),
-        callback = recv_dns_cb
-      })
-      return
-    end
-
     if not r then
       return
     end