From: Andrew Lewis Date: Fri, 17 Mar 2017 11:57:38 +0000 (+0200) Subject: [Minor] Greylisting: fix greylist_min_score X-Git-Tag: 1.5.3~1^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F1534%2Fhead;p=thirdparty%2Frspamd.git [Minor] Greylisting: fix greylist_min_score --- diff --git a/src/plugins/lua/greylist.lua b/src/plugins/lua/greylist.lua index 4a155e8a5e..04d9115451 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',