]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Check actions section sanity
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 11 Apr 2018 13:08:23 +0000 (14:08 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 11 Apr 2018 13:08:23 +0000 (14:08 +0100)
lualib/lua_cfg_transform.lua

index 971b601710a78bc4a64fd921f607cb4e10231ba6..af5bf599984ed3d611aa1c9dea73ad59c11702fc 100644 (file)
@@ -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