]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Do not override high priority settings with low prio ones
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 29 Sep 2016 20:39:35 +0000 (21:39 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 29 Sep 2016 20:40:20 +0000 (21:40 +0100)
Issue: #981
Reported by: @moisseev

src/plugins/lua/settings.lua

index c9c7eeeba04c030a1b742cb179adc1a1d35cacc7..bf403d5bd1dfc1dbc9d38a6720a77304536b4edc 100644 (file)
@@ -270,8 +270,10 @@ local function check_settings(task)
     end
   end
   -- Match rules according their order
+  local applied = false
+
   for pri = max_pri,1,-1 do
-    if settings[pri] then
+    if not applied and settings[pri] then
       for name, r in pairs(settings[pri]) do
         local rule = check_specific_setting(name, r, ip, client_ip, from, rcpt, user, uname)
         if rule then
@@ -279,6 +281,7 @@ local function check_settings(task)
             task:get_message_id(), name)
           if rule['apply'] then
             task:set_settings(rule['apply'])
+            applied = true
           end
           if rule['symbols'] then
             -- Add symbols, specified in the settings