Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Jan 09, 2014 2:17 pm 
Offline
Senior Newbie

Joined: Thu Jan 09, 2014 12:38 am
Posts: 8
My PHP app is now sending mail via Exim just fine to everywhere but Gmail.

Weirdly, if I send to Gmail via the command line, like
Quote:
echo "This is test 1." | mail -s Testing_1 redacted@gmail.com

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 => redacted@gmail.com R=dnslookup T=remote_smtp H=gmail-smtp-in.l.google.com [2607:f8b0:400d:c02::1a] X=TLS1.2:RSA_ARCFOUR_SHA1:128 DN="C=US,ST=California,L=Mountain View,O=Google Inc,CN=mx.google.com"

But if I log into Gmail as redacted@gmail.com, there is no message in the inbox or in spam.

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?


Top
   
PostPosted: Thu Jan 09, 2014 3:44 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Emails a tricky thing, even a single link can block a message getting through spam filters. (I had this problem with yahoo a couple of weeks ago).

What's your server's FQDN
Code:
hostname -f
and the email address you're sending from?

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
PostPosted: Thu Jan 09, 2014 5:22 pm 
Offline
Senior Newbie

Joined: Thu Jan 09, 2014 12:38 am
Posts: 8
hostname -f returns http://www.acceleratenorthfield.org
The sender is baz@acceleratenorthfield.org

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:

Quote:
Received-SPF: fail (google.com: domain of www-data@acceleratenorthfield.org
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 designate
2600:3c00::f03c:91ff:fedb:7934 as permitted sender)


I changed my SPF record from
Quote:
v=spf1 a mx ptr a:mail.acceleratenorthfield.org a:www.acceleratenorthfield.org a:acceleratenorthfield.org ip4:198.58.126.51 mx:mail.acceleratenorthfield.org -all


to
Quote:
v=spf1 a mx ptr a:mail.acceleratenorthfield.org a:www.acceleratenorthfield.org a:acceleratenorthfield.org ip4:198.58.126.51 ipv6:2600:3c00::f03c:91ff:fedb:7934/64 -all mx:mail.acceleratenorthfield.org -all


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.]


Top
   
PostPosted: Thu Jan 09, 2014 8:01 pm 
Offline
Senior Member
User avatar

Joined: Sun Dec 27, 2009 11:12 pm
Posts: 1038
Location: Colorado, USA
You can't have http:// in your FQDN hostname. It should be whatever your computer name is + the domain name (i.e. sparky.acceleratenorthfield.org)

_________________
Either provide enough details for people to help, or sit back and listen to the crickets chirp.
Security thru obscurity is a myth - and really really annoying.


Top
   
PostPosted: Thu Jan 09, 2014 8:24 pm 
Offline
Senior Newbie

Joined: Thu Jan 09, 2014 12:38 am
Posts: 8
Yes, sorry, that was a typo. hostname -f returns www.acceleratenorthfield.org


Top
   
PostPosted: Thu Jan 09, 2014 8:30 pm 
Offline
Senior Newbie

Joined: Thu Jan 09, 2014 12:38 am
Posts: 8
Headers from Gmail (these headers appear on messages for one of the CC recipients whose address is not at Gmail) now confirm the SPF record is correct and complete:

Quote:
Received-SPF: pass (google.com: domain of www-data@acceleratenorthfield.org
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:7934
as permitted sender) smtp.mail=www-data@acceleratenorthfield.org


but message still doesn't appear in Gmail inbox or spam folder.


Top
   
PostPosted: Thu Jan 09, 2014 8:36 pm 
Offline
Senior Member
User avatar

Joined: Sun Dec 27, 2009 11:12 pm
Posts: 1038
Location: Colorado, USA
does hostname return "www" ?

hostname -f should return the hostname+domain

You shouldn't name your server "www"

_________________
Either provide enough details for people to help, or sit back and listen to the crickets chirp.
Security thru obscurity is a myth - and really really annoying.


Top
   
PostPosted: Thu Jan 09, 2014 8:55 pm 
Offline
Senior Newbie

Joined: Thu Jan 09, 2014 12:38 am
Posts: 8
hostname returns northfield
hostname -f returns http://www.acceleratenorthfield.org

/etc/hosts looks like this:
Quote:
127.0.0.1 localhost
127.0.0.1 debian
198.58.126.51 http://www.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


I'm guessing that's b0rked? Can you talk me through fixing it?


Top
   
PostPosted: Fri Jan 10, 2014 12:26 am 
Offline
Senior Member
User avatar

Joined: Sun Dec 27, 2009 11:12 pm
Posts: 1038
Location: Colorado, USA
Here's a CentOS box I'm just getting started setting up the LAMP stack and Web Engine (sorry, it's on a DO droplet, it was the only free dev space I had, and this is a open source gratis project so money is more scarce then the need for Linodes most excellent network and support).

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

_________________
Either provide enough details for people to help, or sit back and listen to the crickets chirp.
Security thru obscurity is a myth - and really really annoying.


Top
   
PostPosted: Fri Jan 10, 2014 9:52 am 
Offline
Senior Newbie

Joined: Thu Jan 09, 2014 12:38 am
Posts: 8
Okay, thanks.

I changed /etc/hosts to
Quote:
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?


Top
   
PostPosted: Fri Jan 10, 2014 2:18 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
You've changed your hostname to northfield.acceleratenorthfield.org however your rDNS is pointing to www.acceleratenorthfield.org you should update this, you should also change -all to ~all in your SPF records -all tends to be a bit aggressive. Update your records give it 24 hours and try again.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: mkorsak and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group