]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Use greylisting threshold in greylisting module
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 16 Oct 2017 19:49:36 +0000 (20:49 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 16 Oct 2017 19:49:36 +0000 (20:49 +0100)
src/plugins/lua/greylist.lua

index 622da4d9a9ab45d20357a1e540451880d697b3db..ce59c5e6e4aed465d420ef13f7102be8adc44dbe 100644 (file)
@@ -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',