Hi,
> This worked fine for 1 user, but how do this for a list of user than I can
> edited with the web interface like a multipmap list ?
Adding support for something along these lines to multimap might be
reasonable but you could use a rule.
You could register and check a map from Lua:
local banned_users_map = rspamd_config:add_map({
type = 'set',
url = '/var/lib/rspamd/banned_users.map',
description = 'User blacklist'
})
rspamd_config.BANNED_USER = {
callback = function (task)
local user = task:get_user()
if not user then return end
if not banned_users_map then return end
local localpart, domain = string.match(user, '(.+)@(.+)')
if not localpart then
localpart = user
end
if banned_users_map:get_key(localpart) then
task:set_pre_result('reject', 'You are forbidden')
return true
end
end,
type = 'prefilter',
}
Best,
-AL.