Email setup with Google Apps, 550-5.7.1 sending from PHP

Ok, I've searched and searched throughout this forum and found lots of people talking about the same or similar subject, but either am too much of a newb or just missing something and I'm having no success with the proposed solutions I've found so far.

The problem that I'm having is when I try to send email with mail() in PHP, I get a response from google saying:

Oct 27 00:23:52 localhost postfix/pickup[15448]: CFC1983C1: uid=33 from= <www-data>Oct 27 00:23:52 localhost postfix/cleanup[15816]: CFC1983C1: message-id=<20101027002352.CFC1983C1@li79-201.members.linode.com>
Oct 27 00:23:52 localhost postfix/qmgr[2146]: CFC1983C1: from=<www-data@li79-201.members.linode.com>, size=369, nrcpt=1 (queue active)
Oct 27 00:24:23 localhost postfix/smtp[15818]: CFC1983C1: to=<daniel@myserver.com>, relay=ASPMX.L.GOOGLE.com[74.125.47.27]:25, delay=30, delays=0.07/0/0.11/30, dsn=5.7.1, status=bounced (host ASPMX.L.GOOGLE.com[74.125.47.27] said: 550-5.7.1 [74.207.237.201 1] Our system has detected an unusual rate of 550-5.7.1 unsolicited mail originating from your IP address. To protect our 550-5.7.1 users from spam, mail sent from your IP address has been blocked. 550-5.7.1 Please visit http://www.google.com/mail/help/bulk_mail.html to review 550 5.7.1 our Bulk Email Senders Guidelines. q34si22091060ybk.66 (in reply to end of DATA command))
Oct 27 00:24:23 localhost postfix/cleanup[15816]: 36E2E83C2: message-id=<20101027002423.36E2E83C2@li79-201.members.linode.com>
Oct 27 00:24:23 localhost postfix/bounce[15821]: CFC1983C1: sender non-delivery notification: 36E2E83C2
Oct 27 00:24:23 localhost postfix/qmgr[2146]: 36E2E83C2: from=<>, size=3103, nrcpt=1 (queue active)
Oct 27 00:24:23 localhost postfix/qmgr[2146]: CFC1983C1: removed
Oct 27 00:24:23 localhost postfix/local[15822]: 36E2E83C2: to=<www-data@li79-201.members.linode.com>, relay=local, delay=0, delays=0/0/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
Oct 27 00:24:23 localhost postfix/qmgr[2146]: 36E2E83C2: removed</www-data@li79-201.members.linode.com></daniel@myserver.com></www-data@li79-201.members.linode.com></www-data> 

I installed from the LAMP StackScript in Linode's library. I've set up a Google Apps account to handle email for my server, and from within that account using Gmail I can send mail from me@MYSERVER.com. However, mailing from my server isn't working.

So far, I have updated my MX records according to their/Linode Library's suggestions (this has been working for a while):

ASPMX.L.GOOGLE.COM 1

ALT1.ASPMX.L.GOOGLE.COM 5

ALT2.ASPMX.L.GOOGLE.COM 5

ASPMX2.GOOGLEMAIL.COM 10

ASPMX3.GOOGLEMAIL.COM 10

I've changed my Reverse DNS to point to MYSERVER.com

And I've added a TXT record for SPF that reads:

Name: (blank)

Value: v=spf1 a mx include:ASPMX.L.GOOGLE.COM ~all

TTL: 3600

my questions:

I'm guessing something is off with the SPF.

It looks like it's sending from www-data@li-*.members.linode.com, though I've set the From: header in my mail() function. Is this expected/correct?

Even if I do get all of this correct, is it likely that Google will still ban my IP? Is there any chance of requesting that they start allowing it if I grovel enough and admit I didn't really know what I was doing until now (now being when everything's correct)?

Thanks for any and all help. I know similar issues have been asked a lot but I just couldn't put it all together for my situation.

1 Reply

The spf record needs to read (you are correct in leaving the name blank):

v=spf1 a include:_spf.google.com ~all

You didn't mention it, so I'll just say that you also need to add a CNAME record for google. It should read like this:

Hostname  Aliases to              TTL
mail      ghs.google.com          Default

The "to=````
postqueue -p

````

Like you said, you may have bumped yourself into a corner with Google in your testing because it does look like your IP got banned for spam. You might want to look into DKIM.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct