Disable local delivery for a virtual domain in postfix

g-suitepostfixsmtp

I have an email server setup with Postfix, MySQL and Dovecot. I am hosting several virtual domains. I am moving one particular domain to Google Apps. Since, Google Apps has limitations on the number of emails you can send in day, I would like to keep the current server setup to send emails. All users would be accessing their emails using Google Apps. The websites and other applications will use the Postfix server to send emails.

I'm wondering if it is possible to disable local delivery(via Dovecot service) for this particular domain. I have searched the Internet for few hours and haven't found anything relevant. If it is possible to have this set up, I would like to know how.

Best Answer

I'm a bit confused about the start of the question but in response to if it's "possible to disable local delivery (via Dovecot service) for this particular domain" this might help:

I think inside /etc/postfix/main.cf that if you're using virtual_alias_domains = me.com you.com then just removing the domain from that line will make Postfix look remotely for delivery if DNS and /etc/hosts etc doesn't tell it otherwise. Do a DNS lookup on that domain's MX records on the Server itself to see where it thinks the MX point.

postfix reload to reload the config should set it live if that's the case.

-edit-

I see what you're after.

Actually it's pretty easy from the Google side: Settings > Accounts > edit info for your outbound e-mail address and configure the settings for authenticated outbound SMTP (this will take a few attempts most likely to get used to how it's laid out).

Then add saslauthd to Postfix and run it over TLS to encrypt the login process so Google's webmail client logs in to be allowed to punt mail through your Server (and anyone with the login and password come to that). Here's a very clear HOWTO, adjust it to your version: Postfix SASL HOWTO

This also has the advantage of your mail appearing to come from your SMTP server directly so other than your MX mentioning Google, and adding SASL's package, nothing has actually changed.