]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Neural: Some default cfg improvements
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 19 Feb 2020 14:59:18 +0000 (14:59 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 19 Feb 2020 14:59:18 +0000 (14:59 +0000)
src/plugins/lua/neural.lua

index 2d1d33ec518082e9d0b5f8d4e505043920903a3b..12dadd8d6ffff2b50658514fc06bc8c316f24ce6 100644 (file)
@@ -1208,8 +1208,8 @@ local function process_rules_settings()
     if profile then
       -- Use static user defined profile
       -- Ensure that we have an array...
-      lua_util.debugm(N, rspamd_config, "use static profile for %s (%s)",
-          rule.prefix, selt.name)
+      lua_util.debugm(N, rspamd_config, "use static profile for %s (%s): %s",
+          rule.prefix, selt.name, profile)
       if not profile[1] then profile = lua_util.keys(profile) end
       selt.symbols = profile
     else
@@ -1261,7 +1261,7 @@ local function process_rules_settings()
         })
   end
 
-  for _,rule in pairs(settings.rules) do
+  for k,rule in pairs(settings.rules) do
     if not rule.allowed_settings then
       rule.allowed_settings = {}
     elseif rule.allowed_settings == 'all' then
@@ -1273,7 +1273,7 @@ local function process_rules_settings()
     rule.allowed_settings = lua_util.list_to_hash(rule.allowed_settings)
 
     -- Check if we can work without settings
-    if type(rule.default) ~= 'boolean' then
+    if k == 'default' or type(rule.default) ~= 'boolean' then
       rule.default = true
     end