]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix another case
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 14 Aug 2019 17:03:31 +0000 (18:03 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 14 Aug 2019 17:03:31 +0000 (18:03 +0100)
lualib/lua_settings.lua

index d03e63e7d5a5333bf811bff4196aa8fcd82724a4..cd8afe3ed89f57369bcdd37dc410f88fcf15779d 100644 (file)
@@ -203,10 +203,18 @@ local function transform_settings_maybe(settings, name)
 
       if apply.symbols then
         -- Check if added symbols are enabled
-        for _,s in pairs(apply.symbols) do
+        for k,v in pairs(apply.symbols) do
+          local s
+          -- Check if we have ["sym1", "sym2" ...] or {"sym1": xx, "sym2": yy}
+          if type(k) == 'string' then
+            s = k
+          else
+            s = v
+          end
           if not symhash[s] then
             lua_util.debugm('settings', rspamd_config,
                 'added symbol %s to symbols_enabled for %s', s, name)
+            apply.symbols_enabled[#apply.symbols_enabled + 1] = s
           end
         end
       end