We have 3 AWS-hosted web servers all configured (as far as I can tell) identically. Each server has a copy of a web feedback form that submits to a PHP script that ultimately calls the php mail() function to send an email to us.

This works fine on 2 of the 3 web servers. On the third, the php mail() function returns 1 (indicating that the mail was sent), /etc/maillog on the web server shows the message as accepted for delivery, and then transferred-on to Google's MX which also accepts the message.

Example mail log for delivery to gmail:

Nov  7 00:40:18 ip-[redacted] sendmail[18499]: sA70eHGI018497: to=<[recipient]>, ctladdr=<apache@ip-[redacted]> (48/48), delay=00:00:01, xdelay=00:00:01, mailer=esmtp, pri=121194, relay=aspmx.l.google.com. [[redacted]], dsn=2.0.0, stat=Sent (OK 1415320818 q110si8698921qgd.122 - gsmtp)

That looks good to me. But the message never shows up in my inbox.

Things I've checked:

  • domain MX records are sane
  • same version of sendmail on all 3 hosts
  • /etc/mailname is set identically on all 3 hosts

Any suggestions?


The last part of that log excerpt confirms that the message was accepted by the recipient mail server at gmail:

relay=aspmx.l.google.com. [[redacted]], dsn=2.0.0, stat=Sent (OK 1415320818 q110si8698921qgd.122 - gsmtp)

The portion in parenthesis is part of the confirmation that the remote server gave back so if you had a support contact at google, they could presumably use that to trace what they did with the message. Considering that it's a free mail service though, getting them to do that is unlikely.

How about checking spam/junk mail folders? Anything there?

  • I've checked everywhere. The same types of messages work through the two other web servers and appear where I expect them. The script that runs is identical. Perhaps I'm unlucky enough to have my EC2 instance's IP address in a blacklisted block for Google. I think I might try configuring SPF for that specific IP address and see if that helps. Thanks for confirming that Google is pretty clearly accepting the message. – Christopher Schultz Nov 8 '14 at 4:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.