1

Topic: Mailgun bounce - Sender address rejected: User unknown in virtual mail

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.5-1
- Linux/BSD distribution name and version: Debian
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? Yes
- Related log if you're reporting an issue:
====

Dear Sir/Madam,

When I try to send a mail with Mailgun, I get the following error (in Mailgun):
Failed: info@xyz.nl → lars@xyz.nl 'Nieuw factuur' Server response: 550 550 5.1.0 <bounce+5adf1e.338b0-lars=xyz.nl@xyz.nl>: Sender address rejected: User unknown in virtual mailbox table

This is my /var/log/mail.log for that part:
Jan 11 22:46:13 es postfix/postscreen[11811]: CONNECT from [209.61.151.225]:22053 to [37.97.209.42]:25
Jan 11 22:46:13 es postfix/postscreen[11811]: WHITELISTED [209.61.151.225]:22053
Jan 11 22:46:13 es postfix/smtpd[11812]: connect from rs225.mailgun.us[209.61.151.225]
Jan 11 22:46:13 es postfix/smtpd[11812]: Anonymous TLS connection established from rs225.mailgun.us[209.61.151.225]: TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)
Jan 11 22:46:14 es postfix/smtpd[11812]: NOQUEUE: reject: RCPT from rs225.mailgun.us[209.61.151.225]: 550 5.1.0 <bounce+5adf1e.338b0-lars=xyz.nl@xyz.nl>: Sender address rejected: User unknown in virtual mailbox table; from=<bounce+5adf1e.338b0-lars=xyz.nl@xyz.nl> to=<lars@xyz.nl> proto=ESMTP helo=<rs225.mailgun.us>
Jan 11 22:46:14 es postfix/smtpd[11812]: disconnect from rs225.mailgun.us[209.61.151.225]

It says that it is whitelisted. I also added the IP to mynetworks in /etc/postfix/main.cf, but postconf -d shows a different value.

How do I solve this issue?

Kind regards,
Lars Jansen

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Mailgun bounce - Sender address rejected: User unknown in virtual mail

*) Does your iRedMail server host mail domain "xyz.nl"?
*) If yes, does mail account "lars@xyz.nl" exist?

3 (edited by hakabe 2017-04-11 11:30:44)

Re: Mailgun bounce - Sender address rejected: User unknown in virtual mail

Had a similar issue. I'm not an expert, but got it working with this:

edit main.cf:
canonical_maps = regexp:/etc/postfix/canonical
canonical_classes = envelope_sender, header_sender
sender_canonical_maps = regexp:/etc/postfix/canonical_sender

edit /etc/postfix/canonical and map it to your existing email account.
/(.*@)yourdomain.com/ existinguser@yourdomain.com

copy canonical to canonical_sender to avoid via Domain headers to be present when relaying:
cp /etc/postfix/canonical /etc/postfix/canonical_sender
postmap /etc/postfix/canonical && /etc/postfix/canonical_sender

restart postfix:
postfix reload && postfix restart