How to Fix Postfix Error: status=bounced (mail for twosmallcoins.com loops back to myself)
After I installed Postfix on my Fedora Linux machine, I realized that my local emails (i.e. logwatch) stopped delivering. Outside emails worked okay.
Diagnose Local Postfix Problems
# echo foo | /usr/sbin/sendmail -f root root && tail -f /var/log/maillog
———————————
May 21 15:26:22 myserver postfix/smtp[28805]: warning: host twosmallcoins.com[76.14.81.68]:25 replied to HELO/EHLO with my own hostname mail.twosmallcoins.com
May 21 15:26:22 myserver postfix/smtp[28805]: DA2761B8158: to=<root@twosmallcoins.com>, relay=twosmallcoins.com[76.14.81.68]:25, delay=0.01, delays=0/0/0/0, dsn=5.4.6, status=bounced (mail for twosmallcoins.com loops back to myself)
———————————-
There are two key realizations here:
- The email is being bounced by postfix filtering. Spam often comes in by using the recipient’s server name.
- My local email is being routed by postfix/smtp. It should be using postfix/local.
Solution: Remove Sendmail
# rpm -e sendmail
or, since I’m using fedora:
# yum remove sendmail
#/etc/init.d/postfix restart
And I was good to go!
I have the same problem. However when I removed sendmail the problem still exists.
It says:
Feb 14 18:28:06 cl-t170-210cl postfix/smtp[4010]: 997009581E5: to=, relay=none, delay=5, delays=0.01/0/5/0, dsn=5.4.6, status=bounced (mail for muzhi.com loops back to myself)
The fix for me was the domain name. I had to add the full domain name for the server to /etc/postfix/mydomains, so in Zhijun Sheng’s example, they would need to add in /etc/postfix/mydomains
muzhi.com OK
then run
/usr/sbin/postmap /etc/postfix/mydomains
hope this helps.