]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Feature] Settings: Allow multiple selectors
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 12 Dec 2018 14:54:11 +0000 (14:54 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 12 Dec 2018 14:54:11 +0000 (14:54 +0000)
src/plugins/lua/settings.lua

index 03f042fc1fa41b14c3dee552116bd7b57fdcf461..62fd63ec7da739b1e985a078a8f0658559b0272e 100644 (file)
@@ -356,7 +356,7 @@ local function check_settings(task)
     end
 
     if rule.selector then
-      res = rule.selector(task)
+      res = fun.all(function(s) return s(task) end, rule.selector)
 
       if res then
         matched[#matched + 1] = 'selector'
@@ -656,7 +656,11 @@ local function process_settings_table(tbl)
       end
 
       if sel then
-        out['selector'] = sel
+        if out.selector then
+          table.insert(out['selector'], sel)
+        else
+          out['selector'] = {sel}
+        end
       end
     end