]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Avoid overwriting whitelisted_signers_map 4019/head
authorReto Kupferschmid <kupferschmid@puzzle.ch>
Thu, 23 Dec 2021 21:53:50 +0000 (22:53 +0100)
committerReto Kupferschmid <kupferschmid@puzzle.ch>
Fri, 24 Dec 2021 07:21:41 +0000 (08:21 +0100)
lualib/lua_dkim_tools.lua
src/plugins/lua/arc.lua

index 53a8a8f0f9db6e6e5e809667a5edfb664ce3487b..06ab819f882c75e36e3cc4e79f6e4a01bf0930a4 100644 (file)
@@ -705,6 +705,8 @@ exports.process_signing_settings = function(N, settings, opts)
       else
         logger.errx(rspamd_config, 'cannot load sign condition %s: %s', v, f)
       end
+    elseif k == 'whitelisted_signers_map' then
+      settings[k] = lua_maps.map_add(N, k, 'set', 'ARC trusted signers domains')
     else
       settings[k] = v
     end
index eeff889f4e51681936a153633506fb3185c52c86..b73dc89e48aa062694288539abeee93cdcf9a1bd 100644 (file)
@@ -413,24 +413,6 @@ rspamd_config:register_symbol({
   groups = {'arc'},
 })
 
-if settings.whitelisted_signers_map then
-  local lua_maps = require "lua_maps"
-  settings.whitelisted_signers_map = lua_maps.map_add_from_ucl(settings.whitelisted_signers_map,
-      'set',
-      'ARC trusted signers domains')
-  if settings.whitelisted_signers_map then
-    arc_symbols.trusted_allow = arc_symbols.trusted_allow or 'ARC_ALLOW_TRUSTED'
-    rspamd_config:register_symbol({
-      name = arc_symbols.trusted_allow,
-      parent = id,
-      type = 'virtual',
-      score = -2.0,
-      group = 'policies',
-      groups = {'arc'},
-    })
-  end
-end
-
 rspamd_config:register_dependency('ARC_CALLBACK', 'SPF_CHECK')
 rspamd_config:register_dependency('ARC_CALLBACK', 'DKIM_CHECK')
 
@@ -741,6 +723,18 @@ if type(settings.forbidden_ids) == 'table' then
   sym_reg_tbl.forbidden_ids = settings.forbidden_ids
 end
 
+if settings.whitelisted_signers_map then
+  arc_symbols.trusted_allow = arc_symbols.trusted_allow or 'ARC_ALLOW_TRUSTED'
+  rspamd_config:register_symbol({
+    name = arc_symbols.trusted_allow,
+    parent = id,
+    type = 'virtual',
+    score = -2.0,
+    group = 'policies',
+    groups = {'arc'},
+  })
+end
+
 rspamd_config:register_symbol(sym_reg_tbl)
 
 -- Do not sign unless checked