diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-10-16 20:49:36 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-10-16 20:49:36 +0100 |
commit | 8994e8b036f1108cbd55ef0a56109aae16f73b6c (patch) | |
tree | 94b3e9b9232e10625de212a18e90053e676cdd9a /src/plugins | |
parent | 83c4748d4c4460fd3e3d929e3daaedb277f9d78e (diff) | |
download | rspamd-8994e8b036f1108cbd55ef0a56109aae16f73b6c.tar.gz rspamd-8994e8b036f1108cbd55ef0a56109aae16f73b6c.zip |
[Fix] Use greylisting threshold in greylisting module
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/lua/greylist.lua | 8 |
1 files changed, 8 insertions, 0 deletions
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', |