]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Avoid pre-result overriding
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 11 Jul 2018 20:29:16 +0000 (21:29 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 11 Jul 2018 20:29:38 +0000 (21:29 +0100)
src/plugins/lua/dmarc.lua
src/plugins/lua/greylist.lua
src/plugins/lua/ratelimit.lua

index 53ece7aa4ed6eee1914f6960b6c2c864144eba12..a7f53b6b259047c5117168126a6b9f03c9d60872 100644 (file)
@@ -198,6 +198,8 @@ local function dmarc_callback(task)
   local function maybe_force_action(disposition)
     local force_action = dmarc_actions[disposition]
     if force_action then
+      -- Don't do anything if pre-result has been already set
+      if task:has_pre_result() then return end
       task:set_pre_result(force_action, 'Action set by DMARC')
     end
   end
index 8de4f69c80f42ba27175f5a6c56c77f7f67d8d67..0bf74bc74184375b6c5c37fe1df6058053f449ee 100644 (file)
@@ -249,6 +249,9 @@ local function greylist_set(task)
   local action = task:get_metric_action('default')
   local ip = task:get_ip()
 
+  -- Don't do anything if pre-result has been already set
+  if task:has_pre_result() then return end
+
   if settings.greylist_min_score then
     local score = task:get_metric_score('default')[1]
     if score < settings.greylist_min_score then
index 786bc71bf002212e66cd7ed9868ababfec5f31d1..654c300cac7259b8e9844a138876556024bcef4b 100644 (file)
@@ -402,6 +402,9 @@ local function ratelimit_cb(task)
     end
   end
 
+  -- Don't do anything if pre-result has been already set
+  if task:has_pre_result() then return end
+
   if nprefixes > 0 then
     -- Save prefixes to the cache to allow update
     task:cache_set('ratelimit_prefixes', prefixes)
@@ -570,7 +573,7 @@ if opts then
     local s = {
       type = 'prefilter,nostat',
       name = 'RATELIMIT_CHECK',
-      priority = 4,
+      priority = 7,
       callback = ratelimit_cb,
       flags = 'empty',
     }