Question wont receive sendmail but gmail does..

Posted December 18, 2013 6.1k views
Hi, I'm using echo "My test email being sent from sendmail" | /usr/sbin/sendmail with hosts file: localhost localhost.localdomain mydomainname The emails reach perfectly fine to gmail accounts (spam) but never reach any accounts. Anyone knows what would could be the issue? I also tried with hosts: targetmoon.localhost mydomainname . Same results. Appreciate any help :) Thanks!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
4 answers
" localhost localhost.localdomain mydomainname"

That's your culprit. You need a properly-formatted /etc/hosts file. See Setting the Hostname & Fully Qualified Domain Name (FQDN) on Ubuntu 12.04 or CentOS 6.4.
Hey Pablo,

I went over the tutorial followed the steps there. Gmail now receive the emails straight to Inbox and not spam but still doesnt show any emails. I have 2 accounts to confirm just in case.

cat /etc/hosts (mydomain myhost myip changed to defaults): localhost.localdomain localhost myhost
123.456.78.90 myhost

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

hostname -f:

hostname -f:

No dot at the end.
Found the problem. Had to add the domain and the to the safe list in outlook.

Notice that isn't automatically white listed with the domain so you have to add it as well.