summaryrefslogtreecommitdiffstats
path: root/lualib/lua_cfg_transform.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-04-11 14:08:23 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-04-11 14:08:23 +0100
commit68329eaa235759a418faefb179b4ebaa22d05040 (patch)
treedaa90455a0b688fa00920cb1afa1d216d82851e8 /lualib/lua_cfg_transform.lua
parent88d41f65cb9b1386dec4baace210841667492f0e (diff)
downloadrspamd-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.lua16
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