master.cf smtpd_sender_restrictions cannot be overridden via extra.cf
Summary
Problem
Settings defined via -o in master.cf cannot be overridden by extra.cf, as master.cf parameters take precedence over main.cf.
Specifically, the smtpd pass service defines its own sender restrictions:
-o smtpd_sender_restrictions=permit_mynetworks,reject_unlisted_sender,reject_unknown_sender_domain
This makes it impossible to override reject_unlisted_sender via extra.cf in a supported, update-safe way.
Impact
Applications like WordPress send mail via wp_mail() using wordpress@<domain> as the sender. Since this address does not exist as a mailbox, Mailcow rejects it with:
550 5.1.0 [email protected]: Sender address rejected: User unknown in virtual mailbox table
Current workaround
Manually editing data/conf/postfix/master.cf and removing reject_unlisted_sender from the smtpd pass service line. This works but requires manual intervention after reviewing master.cf changes on updates.
Expected behavior
Either:
- Move smtpd_sender_restrictions from master.cf into main.cf so it can be properly overridden via extra.cf, or
- Document that master.cf must be edited for this use case and that data/conf/postfix/master.cf is the supported place to do so
Related
- Issue #5830 (same problem with smtpd_helo_restrictions)
Motivation
The extra.cf mechanism exists specifically to allow user-defined overrides without touching core config files. Having restrictions hardcoded in master.cf via -o bypasses this entirely and forces users to manually edit master.cf - defeating the purpose of extra.cf and creating a maintenance burden on updates.
Additional context
No response
Source: mailcow/mailcow-dockerized