A autenticação dependente do remetente pode ajudar. Há um bom exemplo na documentação oficial .
Postfix supports different ISP accounts for different sender addresses (version 2.3 and later). This can be useful when one person uses the same machine for work and for personal use, or when people with different ISP accounts share the same Postfix server.
To make this possible, Postfix supports per-sender SASL passwords and per-sender relay hosts. In the example below, the Postfix SMTP client will search the SASL password file by sender address before it searches that same file by destination. Likewise, the Postfix trivial-rewrite(8) daemon will search the per-sender relayhost file, and use the default relayhost setting only as a final resort.
/etc/postfix/main.cf:
smtp_sender_dependent_authentication = yes
sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
relayhost = [mail.isp.example]
# Alternative form:
# relayhost = [mail.isp.example]:port
/ etc / postfix / sasl_passwd:
# Per-sender authentication; see also /etc/postfix/sender_relay.
[email protected] username1:password1
[email protected] username2:password2
# Login information for the default relayhost.
[mail.isp.example] username:password
# Alternative form:
# [mail.isp.example]:port username:password
/ etc / postfix / sender_relay:
# Per-sender provider; see also /etc/postfix/sasl_passwd.
[email protected] [mail.example.com]:port
[email protected] [mail.example.net]
- Execute o comando "postmap / etc / postfix / sasl_passwd" sempre que você alterar a tabela sasl_passwd.
- Execute o comando "postmap / etc / postfix / sender_relay" sempre que você alterar a tabela sender_relay.