From 86dcbbd9e3e3199b62ae55c5b36d851c6af5af66 Mon Sep 17 00:00:00 2001 From: Andrew Lewis Date: Wed, 24 Aug 2016 11:05:10 +0200 Subject: [PATCH] [Minor] Skip greylisting for local networks as well --- src/plugins/lua/greylist.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 -- 2.39.5