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
<email@example.com>: unknown user: "admin" Final-Recipient: rfc822; firstname.lastname@example.org Original-Recipient: rfc822;email@example.com Action: failed Status: 5.1.1 Diagnostic-Code: X-Postfix; unknown user: "admin"
This is postfix
# 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
192.168.0.0/16 10.0.0.0/8 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 126.96.36.199/16 # -> my domain ip
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: 38902E0550: to=<firstname.lastname@example.org>, 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: D6EEFE0550: to=<email@example.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)