aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/lua/greylist.lua
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2017-03-16 21:07:35 +0200
committerAndrew Lewis <nerf@judo.za.org>2017-03-16 21:07:35 +0200
commit3239783422f1bc391804367384ff4b3dc3effe77 (patch)
treeb1ce7ef99af79d5b2e1a9c353ec5af3c8a5b1711 /src/plugins/lua/greylist.lua
parent81addbcb2e86f9f97866bec1b2a16a78dd91ec87 (diff)
downloadrspamd-3239783422f1bc391804367384ff4b3dc3effe77.tar.gz
rspamd-3239783422f1bc391804367384ff4b3dc3effe77.zip
[Feature] Greylist: Support excluding low-scoring messages from greylisting
Diffstat (limited to 'src/plugins/lua/greylist.lua')
-rw-r--r--src/plugins/lua/greylist.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/plugins/lua/greylist.lua b/src/plugins/lua/greylist.lua
index 407652b6e..4a155e8a5 100644
--- a/src/plugins/lua/greylist.lua
+++ b/src/plugins/lua/greylist.lua
@@ -230,6 +230,19 @@ local function greylist_set(task)
local action = task:get_metric_action('default')
local ip = task:get_ip()
+ if settings.greylist_min_score then
+ local score = task:get_metric_score('default')
+ if score < settings.greylist_min_score then
+ rspamd_logger.infox(task, 'Score too low - skip greylisting')
+ 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
+
if task:get_user() or (ip and ip:is_local()) then
if action == 'greylist' then
-- We are going to accept message