Postfix won't send mail: 553 5.7.1 <user2@example.com>: Sender address rejected: not owned by user user2@example.com
Created by: phdoerfler
Tested with:
swaks --to user2@example.com --from user2@example.com --server mail.example.com:587 --tls -a --protect-prompt -au user2@example.com
All I get is 553 5.7.1 <user2@example.com>: Sender address rejected: not owned by user user2@example.com by postfix. Here's a faithful reproduction of the logs:
-- Logs begin at Fri 2017-08-11 19:29:05 UTC, end at Thu 2017-09-14 07:52:37 UTC. --
Sep 14 07:47:48 mail.example.com dovecot[961]: auth: Debug: client in: AUTH 1 LOGIN service=smtp nologin lip=111.111.111.111 rip=222.222.222.222 secured
Sep 14 07:47:48 mail.example.com dovecot[961]: auth: Debug: client passdb out: CONT 1 VXNlcm5hbWU6
Sep 14 07:47:48 mail.example.com dovecot[961]: auth: Debug: client in: CONT<hidden>
Sep 14 07:47:48 mail.example.com dovecot[961]: auth: Debug: client passdb out: CONT 1 UGFzc3dvcmQ6
Sep 14 07:47:48 mail.example.com dovecot[961]: auth: Debug: client in: CONT<hidden>
Sep 14 07:47:48 mail.example.com dovecot[961]: auth-worker(7520): Debug: Loading modules from directory: /etc/dovecot/modules/auth
Sep 14 07:47:48 mail.example.com dovecot[961]: auth-worker(7520): Debug: pam(user2@example.com,222.222.222.222): lookup service=dovecot2
Sep 14 07:47:48 mail.example.com dovecot[961]: auth-worker(7520): Debug: pam(user2@example.com,222.222.222.222): #1/1 style=1 msg=Password:
Sep 14 07:47:48 mail.example.com dovecot[961]: auth: Debug: client passdb out: OK 1 user=user2@example.com
Sep 14 07:47:48 mail.example.com rmilter[665]: <3274bcd880>; mlfi_envfrom: client is authenticated as: user2@example.com
Sep 14 07:47:48 mail.example.com rmilter[665]: <3274bcd880>; cannot add signature for domain example.com: not found
Sep 14 07:47:48 mail.example.com postfix/smtpd[7516]: NOQUEUE: reject: RCPT from hostname-given-by-isp[222.222.222.222]: 553 5.7.1 <user2@example.com>: Sender address rejected: not owned by user user2@example.com; from=<user2@example.com> to=<user2@example.com> proto=ESMTP helo=<client-helo-name>
Sep 14 07:47:48 mail.example.com postfix/smtpd[7516]: disconnect from hostname-given-by-isp[222.222.222.222] ehlo=2 starttls=1 auth=1 mail=1 rcpt=0/1 quit=1 commands=6/7
A quick google search revealed that this line was missing in the config:
virtual_mailbox_maps = hash:/etc/postfix/vaccounts
it's being set to the same value as this option:
smtpd_sender_login_maps = "hash:/etc/postfix/vaccounts";
However, the issue is not resolved by this. What am I missing?