Allow per-domain relaying without user/pass
For some reason the postfix main.cf on one of our mail servers was missing the auth parts of the per-domain mail relaying changes !1389 (merged). We had per domain relayhost configuration, but relayauth was disabled. Updating to 3.3.0 fixed that issue:
--- etc/postfix/main.cf 2025-04-28 01:45:21.000000000 +0200
+++ /etc/postfix/main.cf 2025-05-19 14:12:16.505958275 +0200
@@ -761,10 +761,10 @@
address_verify_negative_refresh_time = 60s
enable_original_recipient = no
sender_dependent_relayhost_maps = proxy:mysql:/etc/postfix/mysql-virtual_sender-relayhost.cf
-smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
+smtp_sasl_password_maps = proxy:mysql:/etc/postfix/mysql-virtual_sender-relayauth.cf, texthash:/etc/postfix/sasl_passwd
smtp_sender_dependent_authentication = yes
-smtp_sasl_auth_enable = no
-smtp_sasl_security_options =
+smtp_sasl_auth_enable = yes
+smtp_sasl_security_options = noanonymous, noplaintext
smtp_sasl_tls_security_options = noanonymous
authorized_flush_users =
However that introduced another issue: we were doing per-domain relaying without a username/password. This worked for the whole server (setting relayhost) and it worked before the update (because smtp_sasl_auth_enable used to be no) but it didn't work after the update:
server postfix/smtp[XXXXX]: XXXXXXXXXX: to=<user@external.com>, relay=relay.example.com[XXX.XXX.XXX.XXX]:25, delay=0.5, delays=0.23/0.02/0.26/0, dsn=4.7.0, status=deferred (SASL authentication failed; cannot authenticate to server relay.example.com[XXX.XXX.XXX.XXX]: no mechanism available)
That's because /etc/postfix/mysql-virtual_sender-relayauth.cf returns a non-null user:pass answer if there is any relaying configured, even if there isn't a username or password.
I will submit a patch to fix this.
Edited by Judah - MW