Postfix - Recipient Address Rejected: User Unknown in Local Recipient Table

I am learning (trying) to build my own mail server in Centos 7 VM. I have come to a problem when my incoming mails are getting rejected. Using POSTFIX I am trying to send emails from gmail to my mail but it is stucked by this error. Below I will provide as much information as I can. Btw I dont have any DNS record so I am using IP only. User is John.

[root@mail ~]# cat /etc/aliases
john: john

Output from (postconf -d; postconf -d; postconf -n; ) | sort | uniq -u

mydomain = marhyno.info
myhostname = mail
mynetworks = all
mydestination = localhost.$mydomain, localhost, mail.marhyno.info, <myipo>
smtpd_recipient_restrictions =
    permit_sasl_authenticated
    permit_mynetworks
    reject_unauth_destination
resolve_numeric_domain = yes
relay_recipient_maps =
alias_maps = hash:/etc/aliases                                                                            
allow_mail_to_commands = alias,forward,include
allow_mail_to_files = alias,forward,include
biff = no
html_directory = /usr/share/doc/packages/postfix/html
local_recipient_maps = unix:passwd.byname $alias_maps

Output from tail -f /var/log/maillog

Feb 10 01:26:55 mail postfix/smtpd[7531]: connect from mail-yb0-f173.google.com[209.85.213.173]
Feb 10 01:26:56 mail postfix/smtpd[7531]: NOQUEUE: reject: RCPT from mail-yb0-f173.google.com[209.85.213.173]: 550 5.1.1 <john@<myip>>: Recipient address rejected: User unknown in local recipient table; from=<[email protected]> to=<john@<myip>> proto=ESMTP helo=<mail-yb0-f173.google.com>
Feb 10 01:26:56 mail postfix/smtpd[7531]: disconnect from mail-yb0-f173.google.com[209.85.213.173]

Any help will be appreciated :) Thank you.

2 Answers

Solution has been found:

/etc/postfix/main.cf
    local_recipient_maps =

Local recipient maps is enabled by DEFAULT = setting that to empty enables postfix to finally accept message and store it in users file. Also to enable download email to users Outlook - set Chown permissions to the name of the user - e.g. chown john:john /var/spool/mail/john

Also to completely provide solution - change mynetworks = all ... to your home / local subnet ... e.g. my is 192.168.0.0/24

2

I found something like:

With regular expression tables, Postfix only queries with the full recipient address, and not with the bare username or the "@domain.tld" wild-card.

Let me know if that was helpful ;)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

David Miller

David Miller

Executive Financial & Market Analyst

David Miller brings 15 years of experience in global economics, personal finance strategy, and market dynamics. He specializes in turning complex economic trends into actionable insights for everyday readers.

Share this article
Twitter Facebook Pinterest