`Sender address rejected: not owned by user` in Postfix
Solution 1:
According to the manual smtpd_sender_login_maps need to be set. Setting it to the same value as virtual_mailbox_maps worked for me. E.g.:
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
smtpd_sender_login_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
Also, if your maps live in a database, keep in mind you need to actually select a field, not just "1" like some howtos are suggesting.
# good
query = SELECT email FROM postfix_mailbox_maps where email = '%s';
# bad
query = SELECT 1 FROM postfix_mailbox_maps where email = '%s';
Solution 2:
Try this, which is how my server is configured (if your domain is not "virtual", find the correspond options) :
Keep existing options as they were on your initial question, I don't think they are the problem.
Add this in main.cf :
virtual_alias_maps = hash:/etc/postfix/virtual
virtual_mailbox_domains = hash:/etc/postfix/virtual-mailbox-domains
virtual_mailbox_maps = hash:/etc/postfix/virtual-mailbox-users
/etc/postfix/virtual (probably not relevant to you) :
[email protected] [email protected]
[email protected] [email protected]
[email protected] [email protected]
/etc/postfix/virtual-mailbox-domains
exemple.com OK
/etc/postfix/virtual-mailbox-users (This is the important part)
[email protected] [email protected]
[email protected] [email protected]