summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2017-03-13 12:52:29 +0200
committerAndrew Lewis <nerf@judo.za.org>2017-03-13 12:52:29 +0200
commit9cc242cebdb7ef782a5ba847d931d9b1358191bb (patch)
tree565e8131ab81188d99035b1214bdf84a97f7fbaa /src/plugins
parentdfc2fe8153d1dc6a4271373059f215029ca4a2e1 (diff)
downloadrspamd-9cc242cebdb7ef782a5ba847d931d9b1358191bb.tar.gz
rspamd-9cc242cebdb7ef782a5ba847d931d9b1358191bb.zip
[Fix] Greylist: Suppress greylist action for whitelisted hosts too
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/lua/greylist.lua12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/plugins/lua/greylist.lua b/src/plugins/lua/greylist.lua
index 2653564b5..1cb94b6aa 100644
--- a/src/plugins/lua/greylist.lua
+++ b/src/plugins/lua/greylist.lua
@@ -227,14 +227,25 @@ local function greylist_check(task)
end
local function greylist_set(task)
+ local action = task:get_metric_action('default')
local ip = task:get_ip()
if task:get_user() or (ip and ip:is_local()) then
+ if action == 'greylist' then
+ -- We are going to accept message
+ rspamd_logger.infox(task, 'Downgrading metric action from "greylist" to "no action"')
+ task:set_metric_action('default', 'no action')
+ end
return
end
if ip and ip:is_valid() and whitelisted_ip then
if whitelisted_ip:get_key(ip) then
+ if action == 'greylist' then
+ -- We are going to accept message
+ rspamd_logger.infox(task, 'Downgrading metric action from "greylist" to "no action"')
+ task:set_metric_action('default', 'no action')
+ end
return
end
end
@@ -255,7 +266,6 @@ local function greylist_set(task)
end
end
- local action = task:get_metric_action('default')
if action == 'reject' or
not do_greylisting_required and action == 'no action' then
return