Question

Gmail gets mail but not hotmail and its not in spam folder either

Posted October 28, 2013 10.3k views
Hi! I have some problem sending mail from my LAMP installation. The server is used to host different websites. Its a ubuntu 13.04 droplet. 1. I have installed the program sendmail, and didnt do any kind of configuration on that. Using the standard config. 2. I have setup MX record for my DNS inside digital ocean control panel as mail.citynetwork.se. with priority 10 3. When sending a mail by php. I get the mail to gmail but sometimes it goes to spam. In hotmail and my DNS mail client the mail doesnt come in at all.... 4. I looked at the raw mail from gmail and it outputs something like this: Authentication-Results: mx.google.com; spf=neutral (google.com: XXX.XXX.XXX.XXX is neither permitted nor denied by best guess record for domain of my_server_user@localhost.localdomain) smtp.mail=my_server_user@localhost.localdomain my_server_user - Is the user that runs my php script. Should that really be visible here? XXX.XXX.XXX.XXX - Is my ip number localhost.localdomain - shouldnt that be the url of where the php script is running. mysite.com? 5. Further googling i found this page http://www.spamhaus.org/query/ip to check my ip number if its blacklisted. And it was listed in the CBL. With the respond: "This IP address is HELO'ing as "localhost.localdomain". 6. My /etc/hosts file looks like this: 127.0.0.1 localhost localhost.localdomain Akuma What configurations should I do to make it work? My droplet is named akuma.com I have no idea how to solve this. I have tried google for days, been trying solve this problem to long with no luck... Hope someone can help me on this... I'm completely lost.... 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
21 answers
The DigitalOcean LAMP tutorials are missing a section on setting your machine's FQDN. Check out Setting the Hostname & Fully Qualified Domain Name (FQDN) on Ubuntu 12.04 | GitHub.

You should also implement: How To use an SPF Record to Prevent Spoofing & Improve E-mail Reliability.
by Pablo Carranza
A carefully tailored SPF record will reduce the likelihood of your domain name getting fraudulently spoofed and keep your messages from getting flagged as spam before they reach your recipients.
Hi and thanks for your reply!

Okey so I followed your links. But damn, it doesnt work. Still no mail to hotmail and spam in gmail...

I did this steps:

1. In the /etc/hosts file. It looks like this:
––––––––––––––––––––––––––––––––––––
127.0.0.1 localhost.localdomain localhost
127.0.1.1 Akuma.akuma.com Akuma
195.xx.xx.x34 Akuma.akuma.com Akuma

# 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
––––––––––––––––––––––––––––––––––––


2. sudo sendmailconfig
3. sudo service apache2 restart

I have already a TXT record at my dns provider with: "v=spf1 mx a ip4:193.xx.xx.x34 ~all"

Gmail says that email was sent from Akuma.akuma.com Akuma but it should be sent from my virtual host site mysite.com. I mean, can I setup all my virtualhosts urls connected to the ip in the /etc/hosts, and it automatically check and send the email as the virtualhost? Hope you understand me.

But its strange that hotmail doesnt even get my email...

(Akuma and akuma.com is a dummy name for writing here, but it has the same case format)

Any ideas? Really appreciate your time and help!
Try restarting your entire droplet, first: sudo reboot now;

Then, verify that your SPF record is correct @ SPF Wizard.
Hi again!

I did "sudo reboot now". And now I cant connect to the droplet... I have waited for 10 min. How long should it take for it to reboot?
Yikes! It shouldn't take that long. Are you still not able to connect? Have you tried logging in via the console through the D.O. Control Panel?
Hello!

What a coincidence, Digital Ocean had server issues in different locations. When I rebooted. But now its up running again phue :)

Still not working... Still coming to spam in gmail and not coming in to hotmail....


Here is my RAW output of the where I noticed localhost.localdomain
Received: from Akuma.akuma.com (localhost.localdomain [127.0.0.1])
by Akuma.akuma.com (8.14.4/8.14.4/Debian-2.1ubuntu2) with ESMTP id r9SLB2nA001375
for ; Mon, 28 Oct 2013 22:11:02 +0100
Received: (from my_server_user@localhost)


What are your thoughts?

I used your SPF Wizard (and im a total newbie on that) I got this as result:
akuma.com. IN TXT "v=spf1 a ?all"

Do you think that is the problem?


Thanks for your help!


RE: the SPF Wizard,

Are you not originating mail from the hosts that are the subject of your MX records? If you are, then change Do the MX handlers also originate email for this domain? to Yes.

Change How stringent should SPF-aware MTA's treat this? to Soft fail.

What's the output of hostname -f?
Okay, now I got this:
akuma.com. IN TXT "v=spf1 mx a ~all"
Should I add it to the DNS provider?

The result after "hostname -f" is:
Akuma.akuma.com

Thanks!
"Should I add it to the DNS provider?"

Yes.
Ok, I have now added it. Lets wait until it propagates. Will come back withing an hour.
Just to mention, i had this before "v=spf1 mx a ip4:193.xx.xx.x34 ~all"

Talk to you soon! Thanks for your help!! :)
Previous 1 2 3 Next