aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-11-03 19:46:27 +0000
committerGitHub <noreply@github.com>2020-11-03 19:46:27 +0000
commitf707c66711b69fc61ad846dfcfaed52f8187560d (patch)
treed4ba80420c1b9eb2643e5e825a10f10082e601f5
parentbbb31260bd21becaaf465c0560d3a7dfd4de1dc4 (diff)
parentaa3fe37aef648839b36f2ff689b868a96c46c563 (diff)
downloadrspamd-f707c66711b69fc61ad846dfcfaed52f8187560d.tar.gz
rspamd-f707c66711b69fc61ad846dfcfaed52f8187560d.zip
Merge pull request #3539 from fatalbanana/3415
[Fix] Fix settings in case actions are set to null (#3415)
-rw-r--r--lualib/lua_cfg_transform.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/lualib/lua_cfg_transform.lua b/lualib/lua_cfg_transform.lua
index 9d85e4164..ae0f5eac1 100644
--- a/lualib/lua_cfg_transform.lua
+++ b/lualib/lua_cfg_transform.lua
@@ -372,8 +372,10 @@ return function(cfg)
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] and type(cfg.actions[d]) == 'number' then
- if cfg.actions[d] < 0 then
+ if cfg.actions[d] then
+ if type(cfg.actions[d]) ~= 'number' then
+ cfg.actions[d] = nil
+ elseif cfg.actions[d] < 0 then
cfg.actions['no_action'] = cfg.actions[d] - 0.001
logger.infox(rspamd_config, 'set no_action score to: %s, as action %s has negative score',
cfg.actions['no_action'], d)