Debian - Postfix rejecting user (User unknown in local recipient table (in reply to RCPT TO command))
Solution 1:
Postfix - in the default configuration - assumes that mail destined for the mail server gets handled locally. So if you are receiving mail for [email protected]
, and your mail server is called mydomain.example
, that gets handled local
ly. This is how you got the "in local recipient table" error message.
You can see that you are using this default by letting postconf display & expand that setting:
# postconf mydestination
mydestination = $myhostname, localhost.$mydomain, localhost
# postconf -x mydestination
mydestination = mydomain.example, localhost.mydomain.example, localhost
Configure a proper mail server host name & domain. Ideally, not just the second-level mydomain.example
but with a name like mx2.mydomain.example
. The settings myhostname
and mydomain
should typically not equal.
Of course, you can also change which domains are handled locally by configuring mydestination
- removing from that setting those destinations handled via virtual
i.e. via Dovecot. In fact, it is perfectly valid to hand all mail to a virtual
transport and keep mydestination
empty.
In any case, do setup a hostname though, many recipients strongly prefer to receive mail from servers that know who they are. That this indicate that the person who set them up was willing and able to configure a hostname and register its address/name pair in DNS, in both directions.