| Author |
Message |
treybrown
Joined: 06 Jun 2008
Posts: 10
Location: Norman, OK
|
| Posted: Tue Dec 15, 2009 9:04 am Post subject: [SOLVED] Google Apps Email Issue |
|
|
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 |
|
| Back to top |
|
tinono
Joined: 11 Jul 2009
Posts: 30
Location: Martinique
|
| Posted: Tue Dec 15, 2009 10:28 am Post subject: |
|
|
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. |
|
| Back to top |
|
treybrown
Joined: 06 Jun 2008
Posts: 10
Location: Norman, OK
|
| Posted: Tue Dec 15, 2009 10:48 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
treybrown
Joined: 06 Jun 2008
Posts: 10
Location: Norman, OK
|
| Posted: Wed Dec 16, 2009 4:17 pm Post subject: |
|
|
| Okay, so I've made the change suggested and it's still not making into my email |
|
| Back to top |
|
Stu
Joined: 15 Dec 2009
Posts: 4
|
| Posted: Thu Dec 17, 2009 12:36 pm Post subject: |
|
|
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? |
|
| Back to top |
|
treybrown
Joined: 06 Jun 2008
Posts: 10
Location: Norman, OK
|
| Posted: Thu Dec 17, 2009 2:40 pm Post subject: |
|
|
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? |
|
| Back to top |
|
Stu
Joined: 15 Dec 2009
Posts: 4
|
| Posted: Thu Dec 17, 2009 4:57 pm Post subject: |
|
|
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. |
|
| Back to top |
|
treybrown
Joined: 06 Jun 2008
Posts: 10
Location: Norman, OK
|
| Posted: Thu Dec 17, 2009 7:33 pm Post subject: |
|
|
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) |
|
| Back to top |
|
treybrown
Joined: 06 Jun 2008
Posts: 10
Location: Norman, OK
|
| Posted: Thu Dec 17, 2009 7:40 pm Post subject: |
|
|
| 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 |
|
| Back to top |
|
| |