mirror of
https://github.com/rspamd/rspamd.git
synced 2024-09-13 15:45:47 +02:00
[Feature] Lua_maps: Allow static regexp and glob maps
This commit is contained in:
parent
46f70b9b36
commit
a6223eecc7
@ -95,16 +95,32 @@ local function rspamd_map_add_from_ucl(opt, mtype, description)
|
||||
end
|
||||
end
|
||||
elseif mtype == 'regexp' or mtype == 'glob' then
|
||||
-- Plain table
|
||||
local map = rspamd_config:add_map{
|
||||
type = mtype,
|
||||
description = description,
|
||||
url = opt,
|
||||
}
|
||||
if map then
|
||||
ret.__data = map
|
||||
setmetatable(ret, ret_mt)
|
||||
return ret
|
||||
if string.find(opt[1], '^/%a') or string.find(opt[1], '^http') then
|
||||
-- Plain table
|
||||
local map = rspamd_config:add_map{
|
||||
type = mtype,
|
||||
description = description,
|
||||
url = opt,
|
||||
}
|
||||
if map then
|
||||
ret.__data = map
|
||||
setmetatable(ret, ret_mt)
|
||||
return ret
|
||||
end
|
||||
else
|
||||
local map = rspamd_config:add_map{
|
||||
type = mtype,
|
||||
description = description,
|
||||
url = {
|
||||
url = 'static',
|
||||
data = opt,
|
||||
}
|
||||
}
|
||||
if map then
|
||||
ret.__data = map
|
||||
setmetatable(ret, ret_mt)
|
||||
return ret
|
||||
end
|
||||
end
|
||||
else
|
||||
if string.find(opt[1], '^/%a') or string.find(opt[1], '^http') then
|
||||
|
Loading…
Reference in New Issue
Block a user