I had installed and configured dovecot, postfix, and postfixadmin step by step from this tutorial on my server (CentOS6).

I can create virtual mailboxes as well now and can login to roundcubemail, I can also send emails but when I want to send email from other mail systems like gmail, yahoo and etc then I get this error:

This is the mail system at host domain.com.

I'm sorry to have to inform you that your message could not be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can delete your own text from the attached returned message.

The mail system

<admin@domain.com>: unknown user: "admin"

Final-Recipient: rfc822; admin@domain.com
Original-Recipient: rfc822;admin@domain.com
Action: failed
Status: 5.1.1
Diagnostic-Code: X-Postfix; unknown user: "admin"

This is postfix main.cf:

# network settings
inet_interfaces = all
mydomain = domain.com
myhostname = mail.domain.com
mynetworks = $config_directory/mynetworks
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
relay_domains = proxy:mysql:/etc/postfix/mysql-relay_domains_maps.cf

And the mynetworks file:
[::1]/128 [::ffff:]/104 [::1]/128 # -> my domain ip

And mysql-relay_domains_maps.cf:

hosts = localhost
user = postfix
password = postfixpassword
dbname = postfix
query = SELECT domain FROM domain WHERE domain='%s' and backupmx = '1'

The error showing up in the logs is the following:

postfix/local[19002]: 38902E0550: to=<admin@domain.com>, relay=local, delay=0.09, delays=0.06/0.01/0/0.02, dsn=5.1.1, status=bounced (unknown user: "admin")

After reading some posts and I changed mydestination from this

mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain


mydestination = localhost

but after this change, I the error in the logs change to:

postfix/smtp[18844]: D6EEFE0550: to=<admin@domain.com>, relay=none, delay=0.14, delays=0.05/0.01/0.08/0, dsn=5.4.6, status=bounced (mail for domain.com loops back to myself)
  • Please edit the question and add delivery log (i.e. log when postfix reject email) in both conditions, before and after you change mydestination parameter – masegaloeh Jul 14 '14 at 7:21
  • log added, please read it – sIiiS Jul 14 '14 at 8:54
  • I doubt you read all the previous questions containing this error. I guess from these, that the log is from the mydestination = localhost setting, which is apparently false for a public mailserver. To cite from another answer: This happens when domain.com has an MX record (or, in the absence of an MX, an A record) that points to your Postfix server, but your Postfix server is not configured to accept mail for that domain. – sebix Jul 14 '14 at 9:18
  • I did every change but none of them helped me till now, maybe some things is wrong here :( – sIiiS Jul 14 '14 at 10:58
  • Please describe the changes you made and your problems in detail, not, simle things are wrong! You did change relay_domains, which is by default $mydestination, that lists the domains that are deliverd locally. You have to insert your domains into the MySQL table there, have you done that? – sebix Jul 14 '14 at 11:17

If I were you, firstly I would backup mail.log then reverted all changes to the state from the tutorial, then I would add to main.cf:

debug_peer_level = 5
debug_peer_list =

then blanked mail.log cat /dev/null > /var/log/mail.log restarted postfix and manually connect to postfix (here is only the commands I would input):

telnet 25
mail from: <my_email_at@gmail.com>
rcpt to: <admin@domain.com>

then stopped postfix and analyze the logs. Searched for >>> CHECKING RECIPIENT MAPS <<< and looked below fir any errors.

One more question: only admin isn't working or any address ?

  • I do this, and got some log, but can not post here, because I have not enough space for it, but you can see in this link: error log and for your Q, all of the address do not work – sIiiS Jul 14 '14 at 16:02
  • This is interesting cause line 44 of that logs (Jul 14 20:11:36 domain postfix/smtpd[9206]: > localhost[]: 250 2.1.5 Ok) says that the lookup was successful so postfix found that user. I think that there is some logic error in the configuration. I would suggest go through config line by line. Gonna try setup using that tutorial, later today.... – Dawid Jul 14 '14 at 17:23

Problem solved!

Changed host.domain.com to server.domain.com and problem solved, because mail.domain.com was as MX record in my DNS settings

  • -.- So, you could have (very!) easily solved this problem yourself, by searching for the error message in the internet. – sebix Jul 15 '14 at 17:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.