aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-09-29 21:39:35 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-09-29 21:40:20 +0100
commitac77a153fea7cfc809ce6a546f2eb4fccf3cbd53 (patch)
treee4f103b25dbc740250b447f69a3b40358169daaf /src
parent5701dab54afabc0074a86caa36d5469047034ede (diff)
downloadrspamd-ac77a153fea7cfc809ce6a546f2eb4fccf3cbd53.tar.gz
rspamd-ac77a153fea7cfc809ce6a546f2eb4fccf3cbd53.zip
[Minor] Do not override high priority settings with low prio ones
Issue: #981 Reported by: @moisseev
Diffstat (limited to 'src')
-rw-r--r--src/plugins/lua/settings.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/lua/settings.lua b/src/plugins/lua/settings.lua
index c9c7eeeba..bf403d5bd 100644
--- a/src/plugins/lua/settings.lua
+++ b/src/plugins/lua/settings.lua
@@ -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