Okay, so I have read a lot around about the issues im having and the solutions people are offering only solve part of the problem.

1) We have a domain

2) The domain points to our VPS with a static IP running FreeBSD

3) The domain has Google Apps configured

4) Our MX Records point to Google

5) If someone sends us an email we get it in our Gmail, fine.

6) Google apps costs 50 dollars per email address, so we want some pop3 accounts just for development of various things

7) Google is forwarding all our mail to our VPS, and our VPS has postfix and accepts mail for the domain.

8) If in PHP on the VPS we send email to our domain and it gets delivered to the local postfix accounts only

What we want is.

A) Postfix on our VPS to "accept" email for our domain and deliver it locally

B) Postfix to deliver email from our box to Google and not the local boxes

So.... the complication is that it must answer to the domain but not deliver mail locally if it originates from itself / e.g. PHP.

Does anyone have any bright ideas? This one has our network admin stumped because its easy to not deliver locally but then we cant accept incoming mail. And its easy to send all email out, but then we cant accept incoming mail.


Madhava Jay

marked as duplicate by masegaloeh, Katherine Villyard, mdpc, HBruijn, Sven Jan 17 '15 at 9:11

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.

  • 1
    This duplicates the same Postfix-and-Google-Apps ground trodden by this and this existing question. – JdeBP Jun 2 '11 at 16:24

IF I understand what you are trying to do, AND if your PHP can be set to do this, what I would do is see if your ISP has an SMTP server (most do, you just authenticate to it...or you can purchase a relay service cheaply), and send all that traffic out through that. Then it will be routed to the Internet, or back to Google, back to you.


You could try using SMTP to send e-mails from PHP directly to google servers.

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