[Rspamd-Users] Rspamd, Postfix Milter, Alias Rewriting

Florian D rspamd at fd.mytrap.de
Sun May 30 10:48:31 UTC 2021


 > Rspamd is running as a milter, at which time the message has not been
 > delivered, and as such there will be no Delivered-To header yet.
 > (Well, none added by your system; a message could have arrived with
 > one already set.)

Okay, I understand. The milter runs before the final recipient is known, 
makes sense for me now.

 > I don't believe there's anything wrong or needing fixed per se, just do
 > any manual training as the alias rather than as the mailbox, or both, I
 > suppose.  I don't know if there's any way (eg. lua function) you could
 > either change what keys were queried for an alias, or to override the
 > recipient address in rspamd (I don't see anything obvious, but don't
 > know the internals that well), that would probably require a feature
 > request (to specify a map of addresses, maybe?).  Likewise changing
 > postfix's behavior to perform address mapping would also likely require
 > a feature request.

so, can somebody tell me how to overwrite the lookup in rspamd?

As far as I understood the libstat redis-backend source on github, you can
specify a lua function instead of the boolean for the "per_user" setting.

But how does such a function must look like? I'm not really into lua.
As a first approach, a "simple" hardcoded mapping would suffice:

if recipient matches "*@domainB.com" use "mailbox at domainA.com" as lookup.
if recipient matches "*@domainD.com" use "mailbox at domainC.com" as lookup.
if nothing matched, use "mailbox at domainX.com".

How does this look like in lua for rspamd? Are there any hints somewhere 
on how to write this?

Next step then would be to support reading those (raw) hash-tables with 
those mappings from postfix or so?

Thank you!


More information about the Users mailing list