]> git.ipfire.org Git - thirdparty/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)
committerAndrew Lewis <nerf@judo.za.org>
Tue, 17 Oct 2017 22:27:21 +0000 (00:27 +0200)
src/plugins/lua/greylist.lua

index 719ba9270871498a564260c22dedb228a434aae2..ed73be36de6f9d1e6fd86d598779db6c426a3450 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',