From: Vsevolod Stakhov Date: Wed, 12 Dec 2018 14:54:11 +0000 (+0000) Subject: [Feature] Settings: Allow multiple selectors X-Git-Tag: 1.9.0~443 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5b78c367b9cf45c1f32c30ec2e6783fc4c380e63;p=thirdparty%2Frspamd.git [Feature] Settings: Allow multiple selectors --- diff --git a/src/plugins/lua/settings.lua b/src/plugins/lua/settings.lua index 03f042fc1f..62fd63ec7d 100644 --- a/src/plugins/lua/settings.lua +++ b/src/plugins/lua/settings.lua @@ -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