commit 4febe1a: [Minor] Fix some issues

Vsevolod Stakhov vsevolod at rspamd.com
Sat Nov 26 15:42:04 UTC 2022


Author: Vsevolod Stakhov
Date: 2022-11-26 15:31:07 +0000
URL: https://github.com/rspamd/rspamd/commit/4febe1a1d628f134787c3dab0ed8c4fc7d7ac597

[Minor] Fix some issues

---
 src/plugins/lua/settings.lua | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/plugins/lua/settings.lua b/src/plugins/lua/settings.lua
index c18d2a3e9..b8c5736ab 100644
--- a/src/plugins/lua/settings.lua
+++ b/src/plugins/lua/settings.lua
@@ -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 ()


More information about the Commits mailing list