From 289f5ffa7f3103ae19c19330a4227065973eccb6 Mon Sep 17 00:00:00 2001 From: Andrew Lewis Date: Fri, 17 Mar 2017 13:57:38 +0200 Subject: [PATCH] [Minor] Greylisting: fix greylist_min_score --- src/plugins/lua/greylist.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/lua/greylist.lua b/src/plugins/lua/greylist.lua index 4a155e8a5..04d911545 100644 --- a/src/plugins/lua/greylist.lua +++ b/src/plugins/lua/greylist.lua @@ -231,7 +231,7 @@ local function greylist_set(task) local ip = task:get_ip() if settings.greylist_min_score then - local score = task:get_metric_score('default') + local score = task:get_metric_score('default')[1] if score < settings.greylist_min_score then rspamd_logger.infox(task, 'Score too low - skip greylisting') if action == 'greylist' then @@ -388,6 +388,9 @@ if opts then settings[k] = v end end + if settings['greylist_min_score'] then + settings['greylist_min_score'] = tonumber(settings['greylist_min_score']) + end whitelisted_ip = rspamd_map_add('greylist', 'whitelisted_ip', 'radix', 'Greylist whitelist ip map') whitelist_domains_map = rspamd_map_add('greylist', 'whitelist_domains_url', -- 2.39.5