Possible Duplicate:
Why does Postfix deliver mails locally instead of relaying them to Google Apps?

I have a Debian Linux server setup on Linode. I am using Postfix for mail and have set it for myrealdomain.com.

Some of the pages on my site have a php form, that when filled out gets sent to my email address, which is also at myrealdomain.com. I am using Google Apps for my email.

For some reason, I assume since it is sending to the same domain, I never get the email. Changing it to send to my gmail account does work.

How can I fix this?

marked as duplicate by mailq, Michael Hampton, HopelessN00b, Scott Pack, Magellan Oct 8 '12 at 3:30

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


Since your domain is hosted at gmail, why are you using postfix at all ?

A simple (and secure) local nullmailer would suffice for web forms.

  • I am using a CMS. Which requires something like postfix. – Zed Said Oct 1 '12 at 17:24
  • A bit more detail than "something like postfix" would be useful. – adaptr Oct 2 '12 at 7:51
  • All I meant was that my CMS requires postfix or sendmail to be setup in order to send mail. I am using postfix. So that is why I assume it is a postfix config option I need to change? – Zed Said Oct 2 '12 at 17:08

Found the answer: Why does Postfix deliver mails locally instead of relaying them to Google Apps?

It would look like that in your main.cf file:

mydestination = localhost.localdomain, localhost
fallback_transport = relay
  • That's horrible; you're basically providing an open relay to whomever manages to send mail to your server. Please consult the documentation for fallback_transport: postfix.org/postconf.5.html#fallback_transport – adaptr Oct 4 '12 at 10:22
  • Ok, instead of criticizing, why not help out someone who doesn't know much about postfix? I didn't realize this was a bad idea. Looking at the fallback_transport docu doesn't give me a clue as to what I need to change. – Zed Said Oct 4 '12 at 19:23
  • Please provide the output of postconf -n and relevant logs that show what is happening that you don't want to be happening. – adaptr Oct 5 '12 at 13:52
  • Well adding the above fixed my problem. But you said that this is a bad idea. So now I am wondering how I can still having it working how it is, but not have a security issue. – Zed Said Oct 5 '12 at 17:17

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