if settings_id and settings_initialized then
local cached = lua_settings.settings_by_id(settings_id)
+ lua_util.debugm(N, task, "check settings id for %s", settings_id)
if cached then
local elt = cached.settings
if nset then
elt.apply = lua_util.override_defaults(nset, elt.apply)
end
- return elt.apply, cached, cached.priority or 1
end
+ return elt.apply, cached, cached.priority or 1
else
rspamd_logger.warnx(task, 'no settings id "%s" has been found', settings_id)
if nset then
end
local min_pri = 1
+ lua_util.debugm(N, task, "hui: %s", id_elt)
if query_apply then
if priority >= min_pri then
-- Do not check lower or equal priorities
return
end
+ elseif id_elt and type(id_elt.settings) == 'table' and id_elt.settings.external_map then
+ local external_map = id_elt.settings.external_map
+ local selector_result = external_map.selector(task)
+
+ if selector_result then
+ external_map.map:get_key(selector_result, nil, task)
+ -- No more selection logic
+ return
+ else
+ rspamd_logger.infox("cannot query selector to make external map request")
+ end
end
-- Do not waste resources