From: Vsevolod Stakhov Date: Wed, 11 Apr 2018 13:08:23 +0000 (+0100) Subject: [Minor] Check actions section sanity X-Git-Tag: 1.7.4~107 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=68329eaa235759a418faefb179b4ebaa22d05040;p=rspamd.git [Minor] Check actions section sanity --- diff --git a/lualib/lua_cfg_transform.lua b/lualib/lua_cfg_transform.lua index 971b60171..af5bf5999 100644 --- a/lualib/lua_cfg_transform.lua +++ b/lualib/lua_cfg_transform.lua @@ -257,6 +257,22 @@ return function(cfg) end end end + + local actions_set = {} + for _,d in ipairs(actions_defs) do + actions_set[d] = true + end + + -- Now check actions section for garbadge + actions_set['unknown_weight'] = true + actions_set['grow_factor'] = true + actions_set['subject'] = true + + for k,v in pairs(cfg.actions) do + if not actions_set[k] then + logger.warnx('unknown element in actions section: %s', k) + end + end end if not cfg.group then