[Rspamd-Users] Postfix aliases and Rspamd rcpt to address

Jozef Matický cibula at gamepub.sk
Sat Mar 28 10:15:03 UTC 2020


I'm using Postfix with Dovecot LMTP and Rspamd via milter and have one 
I have some catch-all addresses defined in Postfix (pretty much as an 
alias @gamepub.sk to cibula at gamepub.sk), so e-mail sent to 
-anything- at gamepub.sk gets delivered to cibula at gamepub.sk.
In Postfix I have disabled "receive_override_options = 
no_address_mappings" to expand aliases before the content filter (was 
using amavisd before).
I'm using Dovecot LMTP to verify address deliverrability before the 
queue, which is working as expected. Address first gets expanded from 
-anything- at gamepub.sk to cibula at gamepub.sk, then Dovecot is asked if 
such address exists.

Rspamd however is checking user settings based on the non-expanded rcpt 
-anything- at gamepub.sk instead of the expanded cibula at gamepub.sk, thus no 
scores are assigned as such user doesn't exists in the filter settings 
(as with catch all rcpt can be anything).
In Postfix logs, the non-expanded address is displayed as orig_to=, the 
expanded is displayed as to=.
I was thinking about setting @domain.tld user for Rspamd, but the 
catch-all can be redirected to multiple e-mail addresses and I would 
like to respect individual user settings.
I'm not sure how this behaves with redirects configured on Postfix 
(again as an alias), but I assume I will have the same problem.
Some addresses I have configured are aliased to multiple addresses (to 
deliver single email to multiple mailboxes and I assume this will be 
problem as well).

Can someone please advise if this can be somehow configured (to check 
settings of the expanded addresses), if this even is a viable option 
(considering single email, if for example delivered to multiple 
addresses as aliases gets checked multiple times as multiple users, and 
what if one is configured to reject such email and other is not when 
using Rspamd before Postfix queue)?

Thank you.

Postfix log:
Mar 26 14:07:20 zipiju postfix/lmtp[6987]: F230E40383: 
to=<cibula at gamepub.sk>, orig_to=<vub at gamepub.sk>, 
relay=zipiju.bepoint.io[private/dovecot-lmtp], delay=0.02, 
delays=0.01/0.01/0/0, dsn=2.1.5, status=deliverable (250 2.1.5 OK)

Rspamd log:
2020-03-26 14:07:30 #3329(rspamd_proxy) <99c2ac>; proxy; 
rspamd_task_write_log: id: 
<75a2aa243ae14151b6037949e3350e31 at S1000547.vub.sk>, qid: <3D01240383>, 
ip:, from: <nonstopbanking at vub.sk>, (default: F (no 
action): [1.50/nan] [DCC_REJECT(2.00){bulk Body=1 Fuz1=5542 Fuz2=many 
len: 3616, time: 5224.864ms, dns req: 21, digest: 
<596cf435532fd8647f00e2ebebdd69e3>, rcpts: <vub at gamepub.sk>, mime_rcpts: 
<vub at gamepub.sk>

Postfix milter config (12301 is opendkim):
smtpd_milters = inet:localhost:11332,inet:localhost:12301
non_smtpd_milters = inet:localhost:11332,inet:localhost:12301

More information about the Users mailing list