Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Tue Dec 15, 2009 10:04 am 
Offline
Senior Newbie

Joined: Fri Jun 06, 2008 7:25 pm
Posts: 10
Website: http://thesoonergeek.com
Location: Norman, OK
I'm using google apps for email and have noticed that I'm having issues with the mail() function of php. The library article for using google apps doesn't address SPF records, but I'm thinking that's the cause, a friend of mine did some testing and was able to send to an @gmail address without issue, but to a couple other emails it failed, and it's failing to send me mail on the same domain it's on. I also stumbled across this but am unsure of exactly how to interpret it, I'm not that up on DNS knowledge

Edit: forgot the domain, will probably help... thesoonergeek.com


Last edited by treybrown on Thu Dec 17, 2009 8:39 pm, edited 1 time in total.

Top
   
 Post subject:
PostPosted: Tue Dec 15, 2009 11:28 am 
Offline
Junior Member

Joined: Sat Jul 11, 2009 7:19 am
Posts: 30
Location: Martinique
try setting your spf record exactly as google says you should for a start.

Code:
v=spf1 include:aspmx.googlemail.com ~all


Using '-all' instead of '~all' is specifically frowned upon in the very google docs.

Hope it helps.


Top
   
 Post subject:
PostPosted: Tue Dec 15, 2009 11:48 am 
Offline
Senior Newbie

Joined: Fri Jun 06, 2008 7:25 pm
Posts: 10
Website: http://thesoonergeek.com
Location: Norman, OK
Thanks, I used a script that used the Linode API to set it up and that's what it set initially I left it due to lack of knowledge, and once reading the article I linked didn't change it to what google recommended due to the issue it talked about with mail being marked as spam with that specific SPF. I'll try that and go from there, thanks.


Top
   
 Post subject:
PostPosted: Wed Dec 16, 2009 5:17 pm 
Offline
Senior Newbie

Joined: Fri Jun 06, 2008 7:25 pm
Posts: 10
Website: http://thesoonergeek.com
Location: Norman, OK
Okay, so I've made the change suggested and it's still not making into my email


Top
   
 Post subject:
PostPosted: Thu Dec 17, 2009 1:36 pm 
Offline
Senior Newbie

Joined: Tue Dec 15, 2009 10:11 am
Posts: 7
I have a txt record of

v=spf1 include:aspmx.googlemail.com ~all

and its sending fine, I also just migrated all my dns from slicehost to linode and have been sending emails last few days without issue.

do you have your google mail CNAME + MX records set up correctly?


Top
   
 Post subject:
PostPosted: Thu Dec 17, 2009 3:40 pm 
Offline
Senior Newbie

Joined: Fri Jun 06, 2008 7:25 pm
Posts: 10
Website: http://thesoonergeek.com
Location: Norman, OK
Yeah, my MX and CNAMEs are set up correctly.

Stu, the mail() function sends to your Google hosted mail on the same domain just fine?


Top
   
 Post subject:
PostPosted: Thu Dec 17, 2009 5:57 pm 
Offline
Senior Newbie

Joined: Tue Dec 15, 2009 10:11 am
Posts: 7
yep.

Code:
<?
$to="xxxx@xxxxxxxxx.com";
$subject="Test";
$header="from: Test <xxxxx@xxxx.com>";

$message="Hello test foo\r\n";
$message.="another line to send\r\n";
$message.="test sample message";

$sentmail = mail($to,$subject,$message,$header);

if($sentmail){
   echo "Email Has Been Sent .";
}
else
{
   echo "Cannot Send Email ";
}
?>


worked fine. I sent a test mail to my work email from my domain to verify outside with a non gmail/google mail setup domain. also tested as loopback to myself in gmail and again no problems so I know its being delivered internally and externally.

I use msmtp as my MTA. also verified using redmine (ruby) to send email.


Top
   
 Post subject:
PostPosted: Thu Dec 17, 2009 8:33 pm 
Offline
Senior Newbie

Joined: Fri Jun 06, 2008 7:25 pm
Posts: 10
Website: http://thesoonergeek.com
Location: Norman, OK
hmm, so I'm wondering if it's actually my MTA (postfix) that's causing the issue. I don't know why I didn't check mail.log before :oops: but I'm showing the following:

/var/log/mail.log.0:Dec 16 14:40:34 ubuntu postfix/error[17864]: A222716066: to=<user@mydomain.com>, relay=none, delay=0.19, delays=0.08/0.02/0/0.09, dsn=5.0.0, status=bounced (User unknown in virtual alias table)


Top
   
 Post subject:
PostPosted: Thu Dec 17, 2009 8:40 pm 
Offline
Senior Newbie

Joined: Fri Jun 06, 2008 7:25 pm
Posts: 10
Website: http://thesoonergeek.com
Location: Norman, OK
Okay, I found a tip to comment out virtual_alias_domains in main.cf and remove the domain from mydestinations= and it would forward to the MX. This worked and mail is now being send to google apps appropriately


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


Who is online

Users browsing this forum: No registered users 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