aboutsummaryrefslogtreecommitdiffstats
path: root/lualib
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-12-05 18:26:17 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-12-05 18:26:17 +0000
commit48ffe66c9aa764a691c416edb0f52a514397166b (patch)
tree1b419089fef372432b4b6078763133e4c395618b /lualib
parent40759556db803500b4eaaaf443dff0a94320f209 (diff)
downloadrspamd-48ffe66c9aa764a691c416edb0f52a514397166b.tar.gz
rspamd-48ffe66c9aa764a691c416edb0f52a514397166b.zip
[Minor] Do not crash if no actions defined
Diffstat (limited to 'lualib')
-rw-r--r--lualib/rspamd_config_transform.lua28
1 files changed, 14 insertions, 14 deletions
diff --git a/lualib/rspamd_config_transform.lua b/lualib/rspamd_config_transform.lua
index a46ede336..e74c0f689 100644
--- a/lualib/rspamd_config_transform.lua
+++ b/lualib/rspamd_config_transform.lua
@@ -256,21 +256,21 @@ return function(cfg)
if not cfg.actions then
logger.errx('no actions defined')
- end
-
- -- Perform sanity check for actions
- local actions_defs = {'greylist', 'add header', 'add_header',
- 'rewrite subject', 'rewrite_subject', 'reject'}
-
- if not cfg.actions['no action'] and not cfg.actions['no_action'] and
- not cfg.actions['accept'] then
- for _,d in ipairs(actions_defs) do
- if cfg.actions[d] then
- if cfg.actions[d] < 0 then
- cfg.actions['no action'] = cfg.actions[d] - 0.001
- logger.infox('set no action score to: %s, as action %s has negative score',
+ else
+ -- Perform sanity check for actions
+ local actions_defs = {'greylist', 'add header', 'add_header',
+ 'rewrite subject', 'rewrite_subject', 'reject'}
+
+ if not cfg.actions['no action'] and not cfg.actions['no_action'] and
+ not cfg.actions['accept'] then
+ for _,d in ipairs(actions_defs) do
+ if cfg.actions[d] then
+ if cfg.actions[d] < 0 then
+ cfg.actions['no action'] = cfg.actions[d] - 0.001
+ logger.infox('set no action score to: %s, as action %s has negative score',
cfg.actions['no action'], d)
- break
+ break
+ end
end
end
end