Messages sent by Exim to Gmail never arrive.
Weirdly, if I send to Gmail via the command line, like
> echo "This is test 1." | mail -s Testing_1
the message arrives promptly in the inbox.
BUT
When my PHP app sends a message to Gmail, their servers appear (based on the Exim logfile) to accept the message without error, but the message never arrives in the inbox (or spam folder). I have tried several different Gmail addresses with the same result.
Here's an example of a happy-looking logfile message:
2014-01-09 11:52:54 1W1JmV-0000Eh-Cw =>
But if I log into Gmail as
Best I can tell, I have a valid SPF record that authorizes linode to send mail for my domain. Not sure what other sins I could be committing.
Any ideas?
10 Replies
What's your server's FQDN
hostname -f
and the email address you're sending from?
The sender is
In the process of answering that question, I checked the full message headers on one of the other, non-gmail recipients of one of the failed messages, and here is what I found:
> Received-SPF: fail (google.com: domain of
does not designate 2600:3c00::f03c:91ff:fedb:7934 as permitted sender)
client-ip=2600:3c00::f03c:91ff:fedb:7934;
Authentication-Results: mx.google.com; spf=hardfail (google.com: domain of
www-data@acceleratenorthfield.org does not designate2600:3c00::f03c:91ff:fedb:7934 as permitted sender)
I changed my SPF record from
> v=spf1 a mx ptr a:mail.acceleratenorthfield.org a:
to
> v=spf1 a mx ptr a:mail.acceleratenorthfield.org a:
Now I no longer get the SPF fails in the message headers, but my messages still don't show up in my Gmail inboxes.
[CORRECTION: I'm still getting the old fails, so the SPF record must not have propagated yet. I'll try again in a couple of hours.]
> Received-SPF: pass (google.com: domain of
designates 2600:3c00::f03c:91ff:fedb:7934 as permitted sender)
client-ip=2600:3c00::f03c:91ff:fedb:7934;
Authentication-Results: mx.google.com; spf=pass (google.com: domain of
www-data@acceleratenorthfield.org designates 2600:3c00::f03c:91ff:fedb:7934as permitted sender) smtp.mail=
www-data@acceleratenorthfield.org
but message still doesn't appear in Gmail inbox or spam folder.
hostname -f should return the hostname+domain
You shouldn't name your server "www"
hostname -f returns
/etc/hosts looks like this:
> 127.0.0.1 localhost
127.0.0.1 debian
198.58.126.51
http://www.acceleratenorthfield.org northfieldThe following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
I'm guessing that's b0rked? Can you talk me through fixing it?
nano /etc/hosts
127.0.0.1 localhost localhost.localdomain
192.241.224.196 midori.ipcopsupport.org midori
nano /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=midori.ipcopsupport.org
hostname
returns midori
hostname -f
returns midori.ipcopsupport.org
I changed /etc/hosts to
> 127.0.0.1 localhost localhost.localdomain
198.58.126.51 northfield.acceleratenorthfield.org northfield
The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
and rebooted.
hostname responds northfield
hostname -f responds northfield.acceleratenorthfield.org
My web apps are all still running fine.
I re-tested my email issue, and found no change:
When I have PHP send a single message with multiple recipients, the non-Gmail accounts receive the message, and the Gmail accounts do not. No errors in the Apache logs.
Anyone have ideas what to try next?