]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Skip greylisting for local networks as well 890/head
authorAndrew Lewis <nerf@judo.za.org>
Wed, 24 Aug 2016 09:05:10 +0000 (11:05 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Wed, 24 Aug 2016 09:05:10 +0000 (11:05 +0200)
src/plugins/lua/greylist.lua

index 8f584b76cce22bf4a2b4ce81bb40cf18cf65a81a..05afaeab6875d4245ed6cd15c4b2896de82d233f 100644 (file)
@@ -126,7 +126,9 @@ local function check_time(task, tm, type)
 end
 
 local function greylist_check(task)
-  if task:get_user() ~= nil then
+  local ip_addr = task:get_ip()
+
+  if task:get_user() or (ip_addr and ip_addr:is_local()) then
     return
   end
 
@@ -208,7 +210,9 @@ local function greylist_check(task)
 end
 
 local function greylist_set(task)
-  if task:get_user() ~= nil then
+  local ip_addr = task:get_ip()
+
+  if task:get_user() or (ip_addr and ip_addr:is_local()) then
     return
   end