New in CWP Edge-LatestFree with every CWPpro licenceWebsites up to 300x faster

CWP now includes LSPHP, LSAPI-Cache and CWP Cage at no extra cost with all CWPpro licences. The LSAPI-Cache plugin is integrated into our WordPress and other script installers, and CWP Cage gives every user complete isolation. Available now in the CWP Edge-Latest version.

Get CWPpro ›

Rspamd Migration Bug – Email Forwarders Fail Due to Postfix Address Mapping Conf

Started by domecca, Today at 04:04:23 PM

Previous topic - Next topic

domecca

After migrating from Amavis/SpamAssassin to Rspamd using CWP's MailServer Manager, I discovered that messages classified as spam and addressed to email forwarders are not being delivered to the destination mailbox's Spam folder. CWP's Spam Filter interface reports successful routing to the Spam folder, but Postfix attempts to deliver the message directly to the forwarding address, resulting in a bounce.

The Postfix logs show the following error:

dsn=5.1.1, status=bounced
550 5.1.1 User doesn't exist: user1@domain.com

After investigating, I identified the following service override remaining in /etc/postfix/master.cf:

smtpd pass - - n - - smtpd
    -o receive_override_options=no_address_mappings

This setting disables virtual alias expansion. It appears to be retained from the previous Amavis configuration, where address mapping was performed after mail was reinjected into Postfix.

Reviewing /scripts/mail_rspamd, the postfix_apply() function correctly removes the Amavis content filter:

postconf -PX $(smtp_svc)/content_filter >/dev/null 2>&1
postconf -e content_filter= >/dev/null 2>&1

However, it does not remove no_address_mappings from receive_override_options.

Since Rspamd operates as a Postfix milter rather than an external content filter requiring reinjection, this override appears to be no longer necessary.

The proposed workaround for my current configuration is:

postconf -PX smtpd/pass/receive_override_options
postfix check && postfix reload

I recommend updating the postfix_apply() function to remove no_address_mappings while preserving any other applicable override options. The rollback function should also restore the appropriate configuration when switching back to Amavis.

Since postfix_apply() is also called after a mail server rebuild, this issue could be reintroduced even after manually correcting the Postfix configuration.

This potentially affects all email aliases and forwarders on servers migrating from Amavis to Rspamd, resulting in bounced messages and unintended backscatter to spam senders.