[Rspamd-Users] per-user blacklist implementation
Szabó Nándor
medve at wenetto.hu
Sun Feb 1 17:05:17 UTC 2026
Hello list members,
I tried to create a per-user blacklist implementation in rspamd.
Key and value stored in Redis: user at domain.hu (rcpt_to) and bad_user(from).
- Writing to Redis: this works.
Dovecot+sieve custom script does this, using redis-cli.
redis-cli HSET "user_senders_blacklist" "user:${RCPT}:${FROM}" 1
- Reading from Redis and rspamd scoring.
Unfortunately, this does not work at all.
I tried two methods:
1) Multimap module
USER_SENDER_BLACKLIST {
type = "from";
filter = "email:addr";
map = "redis://user:${rcpt}";
score = 10.0;
description = "Per-user sender blacklist";
debug = true;
}
It didn't work because multimap can only handle 1-dimensional queries.
Doesn't support two-dimensional (rcpt + from) lookups, or dynamic Redis
key selection based on ${rcpt}.
2) Own LUA worker module
Processes incoming mail and scores it based on Redis reading.
Due to Lua API limitations, LUA script does not run.
proxy; lua_metric_symbol_callback: call to (RSBL_USER_SENDER) failed
(2): /etc/rspamd/lua.local.d/rsbl_user_sender.lua:54: attempt to call
method 'get_redis' (a nil value); trace:
[1]:{/etc/rspamd/lua.local.d/rsbl_user_sender.lua:54 - <unknown> [Lua]};
I am using Debian 12 + packaged rspamd, version 3.14.
It turns out that it does not support dynamic Redis READ from Lua.
Running your own LUA is only possible with a custom-compiled rspamd
package. Is this true?
Has anyone managed to create such a user-based blacklist rule?
Thanks for support.
--
Regards
Nandor
More information about the Users
mailing list