aboutsummaryrefslogtreecommitdiffstats
path: root/lualib/lua_selectors/init.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2022-12-12 21:33:58 +0000
committerVsevolod Stakhov <vsevolod@rspamd.com>2022-12-12 21:33:58 +0000
commit2b582c23dcb975ea5c8cedf278e4cf280901c2f0 (patch)
treee089ccb5e368f28503bd54a72a5bafbb9c4011cc /lualib/lua_selectors/init.lua
parent531eca803018c0cf41069e448ff801825cac97fc (diff)
downloadrspamd-2b582c23dcb975ea5c8cedf278e4cf280901c2f0.tar.gz
rspamd-2b582c23dcb975ea5c8cedf278e4cf280901c2f0.zip
[Feature] Allow to specify `selector_alias` in the maps definition
Diffstat (limited to 'lualib/lua_selectors/init.lua')
-rw-r--r--lualib/lua_selectors/init.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/lualib/lua_selectors/init.lua b/lualib/lua_selectors/init.lua
index f85b9a487..39cf654f3 100644
--- a/lualib/lua_selectors/init.lua
+++ b/lualib/lua_selectors/init.lua
@@ -616,4 +616,12 @@ exports.list_transforms = function()
return display_selectors(transform_function)
end
+exports.add_map = function(name, map)
+ if not exports.maps[name] then
+ exports.maps[name] = map
+ else
+ logger.errx(rspamd_config, "duplicate map redefinition for the selectors: %s", name)
+ end
+end
+
return exports