Google Apps mail: can't send to server from same server

I converted over to using Google Apps for mail, and it's working great now except for being able to send an email to one of my own server address from the same server (for example, in a "contact us" php web form). I believe I've got the MX records and SPF set up correctly based on my all the searching and tests I've done. I can send mail to outside email addresses from the server, and Google Apps is receiving email for my server from outside addresses.

I just can't send an email to the server from the server itself.

I originally followed the very detailed Postfix+Dovecot+Mysql mail setup in the linode library, and I think this problem is related to some postfix setting used in that setup. In /etc/postfix/main.cf I changed "virtual_transport" from "dovecot" to "local:" but that didn't work, the email just ends up in the mailbox on the server itself, not Google, and /var/log/mail.log says "status=sent". So it's getting sent, just not "outside" like it needs to be. Here's the log for a message I just tried:

> Oct 25 02:21:18 localhost postfix/pickup[20392]: B719FE97E: uid=0 from= Oct 25 02:21:18 localhost postfix/cleanup[20398]: B719FE97E: message-id=<20101025022118.B719FE97E@mydomain.com>

Oct 25 02:21:18 localhost postfix/qmgr[20393]: B719FE97E: from=<root@mydomain.com>, size=364, nrcpt=1 (queue active)

Oct 25 02:21:18 localhost postfix/local[20401]: B719FE97E: to=<contact@mydomain.com>, relay=local, delay=0.03, delays=0.03/0.01/0/0, dsn=2.0.0, status=sent (delivered to mailbox)

Oct 25 02:21:18 localhost postfix/qmgr[20393]: B719FE97E: removed

Hopefully this is some simple setting I'm missing…

2 Replies

I think I found the problem! Turns out postfix was seeing my server domain as "virtual" and therefore using those "virtual_*" settings for it. What I needed to do was tell postfix it wasn't virtual anymore.

In the guide for setting up postfix+dovecot+mysql, there is a file called mysql-virtual_domains.cf that is created. In that file I changed the "query" line to return an empty result from mysql but otherwise left it the same, in case I set up another domain on this linode that wants local mail instead of google.

It all seems to work fine now. YAY! :D

Can you share the records you use for correct google apps spf records?

Email still going to my spam box.

Thanks

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