]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix settings in case actions are set to null (#3415) 3539/head
authorAndrew Lewis <nerf@judo.za.org>
Tue, 3 Nov 2020 08:46:56 +0000 (10:46 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Tue, 3 Nov 2020 08:47:18 +0000 (10:47 +0200)
lualib/lua_cfg_transform.lua

index 9d85e41649355ae6742570ba7d9f835454bced87..ae0f5eac1f9a8ed108f401443c847e9586edc51f 100644 (file)
@@ -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)