From 8994e8b036f1108cbd55ef0a56109aae16f73b6c Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 16 Oct 2017 20:49:36 +0100 Subject: [PATCH] [Fix] Use greylisting threshold in greylisting module --- src/plugins/lua/greylist.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/plugins/lua/greylist.lua b/src/plugins/lua/greylist.lua index 622da4d9a..ce59c5e6e 100644 --- a/src/plugins/lua/greylist.lua +++ b/src/plugins/lua/greylist.lua @@ -402,14 +402,22 @@ if opts then if opts['message_func'] then settings.message_func = assert(load(opts['message_func']))() end + for k,v in pairs(opts) do if k ~= 'message_func' then settings[k] = v end end + if settings['greylist_min_score'] then settings['greylist_min_score'] = tonumber(settings['greylist_min_score']) + else + local greylist_threshold = rspamd_config:get_metric_action('greylist') + if greylist_threshold == greylist_threshold then + settings['greylist_min_score'] = greylist_threshold + end 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