diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-02-12 15:03:30 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-02-12 15:03:30 +0000 |
commit | 098bad331a1bfad297c519ae2d310eb3639b94ba (patch) | |
tree | ec990018f59c93c34f3256537e228cf1c47d735b /lualib | |
parent | 3d2cadb16676133ac3007da65630996168be3c91 (diff) | |
download | rspamd-098bad331a1bfad297c519ae2d310eb3639b94ba.tar.gz rspamd-098bad331a1bfad297c519ae2d310eb3639b94ba.zip |
[Project] Implement new flags in Lua API
Diffstat (limited to 'lualib')
-rw-r--r-- | lualib/lua_squeeze_rules.lua | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lualib/lua_squeeze_rules.lua b/lualib/lua_squeeze_rules.lua index 1df8a4ec1..0062504bc 100644 --- a/lualib/lua_squeeze_rules.lua +++ b/lualib/lua_squeeze_rules.lua @@ -322,12 +322,13 @@ exports.handle_settings = function(task, settings) local symbols_disabled = {} local symbols_enabled = {} local found = false + local disabled = false if settings.default then settings = settings.default end local function disable_all() - for k,_ in pairs(squeezed_symbols) do - if not symbols_enabled[k] then + for k,sym in pairs(squeezed_symbols) do + if not symbols_enabled[k] and not (sym.flags and sym.flags.explicit_disable) then symbols_disabled[k] = true end end @@ -336,6 +337,7 @@ exports.handle_settings = function(task, settings) if settings.symbols_enabled then disable_all() found = true + disabled = true for _,s in ipairs(settings.symbols_enabled) do if squeezed_symbols[s] then lua_util.debugm(SN, task, 'enable symbol %s as it is in `symbols_enabled`', s) @@ -346,7 +348,9 @@ exports.handle_settings = function(task, settings) end if settings.groups_enabled then - disable_all() + if not disabled then + disable_all() + end found = true for _,gr in ipairs(settings.groups_enabled) do if squeezed_groups[gr] then |