From: Andrew Lewis Date: Wed, 24 Aug 2016 09:05:10 +0000 (+0200) Subject: [Minor] Skip greylisting for local networks as well X-Git-Tag: 1.3.5~29 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=92acbb09d2f30d501ab03e71090ff4adb38d6383;p=rspamd.git [Minor] Skip greylisting for local networks as well --- diff --git a/src/plugins/lua/greylist.lua b/src/plugins/lua/greylist.lua index 8f584b76c..05afaeab6 100644 --- a/src/plugins/lua/greylist.lua +++ b/src/plugins/lua/greylist.lua @@ -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