Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

posts/using-multiple-smtpd-sender-login-maps-in-postfix #326

Open
utterances-bot opened this issue Oct 22, 2024 · 2 comments
Open

posts/using-multiple-smtpd-sender-login-maps-in-postfix #326

utterances-bot opened this issue Oct 22, 2024 · 2 comments

Comments

@utterances-bot
Copy link

A Postfix deployment postmortem: Debugging short-circuiting of mapping lookups

How we tracked down and fixed a bug caused by Postfix’s type:table using the new unionmap feature.

https://monadical.com/posts/using-multiple-smtpd-sender-login-maps-in-postfix.html

Copy link

Heya Nick,

Here's what I have on the files:

root@wolflair:/etc/postfix# cat sender_logins.cf
user = db_user
password = db_password
hosts = 127.0.0.1
dbname = db_name
query = SELECT email FROM virtual_users WHERE email='%s'
root@wolflair:/etc/postfix# cat sender_overrides.cf
/.*@test.dev/                     user2@test.dev

Now, user2 is able to send mails as any email prefix but when user1 attempts, throws error message

Sender address rejected: not owned by user user1@test.dev. Please check the message recipient

user1 has aliases like quality, security, postmaster mapped

Am I missing any entries specific to user1 in the sender_overrides.cf file?

Appreciate any help. Thanks!

Copy link

Additionally, this is from the main.cf file:

# Restrictions
smtpd_helo_restrictions =
        permit_mynetworks,
        permit_sasl_authenticated,
        reject_invalid_helo_hostname,
        reject_non_fqdn_helo_hostname
smtpd_recipient_restrictions =
        permit_mynetworks,
        permit_sasl_authenticated,
        reject_non_fqdn_recipient,
        reject_unknown_recipient_domain,
        reject_unlisted_recipient,
        reject_unauth_destination,
smtpd_sender_restrictions =
        permit_mynetworks,
        reject_sender_login_mismatch,
        permit_sasl_authenticated,
        reject_non_fqdn_sender,
        reject_unknown_sender_domain,
smtpd_relay_restrictions =
        permit_mynetworks,
        permit_sasl_authenticated,
        defer_unauth_destination
smtpd_sender_login_maps = unionmap:{
        mysql:/etc/postfix/sender_logins.cf,
        pcre:/etc/postfix/sender_overrides.cf }

# Handing off local delivery to Dovecot's LMTP, and telling it where to store mail
virtual_transport = lmtp:unix:private/dovecot-lmtp

# Virtual domains, users, and aliases
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf, mysql:/etc/postfix/mysql-virtual-email2email.cf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants