diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-12-15 22:35:40 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-12-15 22:35:40 +0000 |
commit | f5310feebd6b98b701301b0b331c6037075985e9 (patch) | |
tree | d617dc5c2b29b5ddc1e6e89cfc668ac6ac8402ea | |
parent | c1d2d836526df04c66ab40e31bdf8f80951bb64f (diff) | |
download | rspamd-f5310feebd6b98b701301b0b331c6037075985e9.tar.gz rspamd-f5310feebd6b98b701301b0b331c6037075985e9.zip |
[Minor] Allow to attach maps to the RBL module
-rw-r--r-- | src/plugins/lua/rbl.lua | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/plugins/lua/rbl.lua b/src/plugins/lua/rbl.lua index 621903f99..7336ce380 100644 --- a/src/plugins/lua/rbl.lua +++ b/src/plugins/lua/rbl.lua @@ -1201,7 +1201,19 @@ if(opts['local_exclude_ip_map'] ~= nil) then 'RBL exclusions map') end -for key,rbl in pairs(opts.rbls ) do +-- TODO: this code should be universal for all modules that use selectors to allows +-- maps attachment to a specific module +if type(opts.attached_maps) == 'table' then + opts.attached_maps_processed = {} + for i,map in ipairs(opts.attached_maps) do + opts.attached_maps_processed[i] = lua_maps.map_add_from_ucl(map) + if opts.attached_maps_processed[i] == nil then + rspamd_logger.warnx(rspamd_config, "cannot parse attached map: %s", map) + end + end +end + +for key,rbl in pairs(opts.rbls) do if type(rbl) ~= 'table' or rbl.disabled == true or rbl.enabled == false then rspamd_logger.infox(rspamd_config, 'disable rbl "%s"', key) else |