diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-04-11 14:08:23 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-04-11 14:08:23 +0100 |
commit | 68329eaa235759a418faefb179b4ebaa22d05040 (patch) | |
tree | daa90455a0b688fa00920cb1afa1d216d82851e8 /lualib/lua_cfg_transform.lua | |
parent | 88d41f65cb9b1386dec4baace210841667492f0e (diff) | |
download | rspamd-68329eaa235759a418faefb179b4ebaa22d05040.tar.gz rspamd-68329eaa235759a418faefb179b4ebaa22d05040.zip |
[Minor] Check actions section sanity
Diffstat (limited to 'lualib/lua_cfg_transform.lua')
-rw-r--r-- | lualib/lua_cfg_transform.lua | 16 |
1 files changed, 16 insertions, 0 deletions
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 |