]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix some issues
authorVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 26 Nov 2022 15:31:07 +0000 (15:31 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 26 Nov 2022 15:31:07 +0000 (15:31 +0000)
src/plugins/lua/settings.lua

index c18d2a3e9bf5f2b9ab33c01fe50037fdf0e8d4b2..b8c5736abf5dd533e4d96932395dd75a3756ccf8 100644 (file)
@@ -360,7 +360,7 @@ local function check_settings(task)
     local selector_result = external_map.selector(task)
 
     if selector_result then
-      external_map.map:get_key(selector_result)
+      external_map.map:get_key(selector_result, nil, task)
       -- No more selection logic
       return
     else
@@ -1338,6 +1338,9 @@ elseif set_section and type(set_section) == "table" then
     if maybe_external_map.map and maybe_external_map.selector then
       rspamd_logger.infox(rspamd_config, "added external map for user's settings")
       external_map = maybe_external_map
+      set_section.external_map = nil -- to avoid internal processing
+    else
+      rspamd_logger.warnx(rspamd_config, "cannot add external map for user's settings")
     end
   end
   rspamd_config:add_post_init(function ()