Tran Nghi's Site  - Make notes and share experience

Rejecting Unknown Local Recipients with Postfix

This post is also available in: English

By default, the Postfix SMTP server rejects mail for unknown recipients in local domains.. this configuration causes the problem when you try sending an email (ie. from Mozilla Thunderbird) to unknown user in the same domain, it will pop-up a windows like this (it was not happened with Gmail):

I found this regarding document (http://www.postfix.org/LOCAL_RECIPIENT_README.html), but this made no difference. Finally, I recognize that this is because the current postfix system is using virtual_alias_maps (and other virtual mailbox solutions don’t seem to apply here either). So I tried some research more, like these (try them, then you will see some interesting things):

[email protected]:~#     postconf | grep local
[email protected]:~#     postconf | grep recipient
[email protected]:~#     postconf | grep unknown

After all, I re-configured these below lines (/etc/postfix/main.cf):

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

Try again from email client, hopefully, it’s working pretty well now.

Updated on Jan 19, 2018: the above method maybe cause the problem with some other running services on your system. If so, let’s redo as the original. Then follow below is exact what we need to do for this subject:

I was recognize the problem by investigation:

[email protected]:~#     postconf | grep reject

 

So, I tried to re-config postfix:

[email protected]:~#     postconf -e “smtpd_reject_unlisted_recipient = no”
[email protected]:~#     postfix reload

Now, the problem is totally solved.

Message