Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I currently have a Postfix/Dovecot setup, but our server is hitting capacity, so we decided to switch to Google Apps. However, we have certain web applications that need to send and receive e-mail directly (for example, inbound e-mail being redirected to a script, and sending password-reset e-mails).

What I want to do is host certain e-mail accounts with Google Apps, while my current server continues to manage other e-mail accounts. I assume this means that I would use my current server as an Inbound/Outbound Gateway, so my questions are:

1) How do I setup Postfix as an Outbound Gateway without making it an (insecure) open relay?

2) How do I setup Postfix as an Inbound Gateway so that only certain e-mail addresses are forwarded to Google Apps?

3) I was also considering a dual-SMTP approach where both Google Apps and my server can send mail directly to the outside world, but would this be spam-filter friendly? I want to keep using a single domain for all e-mail addresses if possible.

Thank you!

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

I'm going to suggest you configure things a little differently. Google's more redundant then your one server and it will cause many fewer problems with mail delivery. The issue is, if you forward a lot of messages from an smtp server, sometimes google throttles an ip even if it has been whitelisted in the Google Apps CPanel. We've had to get Google to whitelist (not the same as the CPanel whitelist) a few SMTP relays we maintain for legacy domains.

Have your MX records all point to your Google Apps domain. You can then add static routes on each mailbox you want to forward over to the postfix server. Create a firewall rule to only accept email from google's IP networks which can be found in the spf record listed below. You might want to look at this on a regular once or twice a year to make sure it hasn't changed. Add the Postfix server's ip to your spf record and the relevant google information by following Google's instructions for creating SPF records.

SPF records are you best protection from looking like a spammer.

$ dig txt _spf.google.com

;; ANSWER SECTION: _spf.google.com. 300 IN TXT "v=spf1 ip4:216.239.32.0/19 ip4:64.233.160.0/19 ip4:66.249.80.0/20 ip4:72.14.192.0/18 ip4:209.85.128.0/17 ip4:66.102.0.0/20 ip4:74.125.0.0/16 ip4:64.18.0.0/20 ip4:207.126.144.0/20 ip4:173.194.0.0/16 ?all"

Here is the SPF record for one of the 60 domains I manage. Your SPF record should look something like this:

oeh.com. 3600 IN TXT "v=spf1 a:czar.oeh.com a:kaiser.oeh.com ip4:12.52.185.83 ip4:64.88.185.105 ip4:173.45.98.190 include:listrak.com include:_spf.google.com ~all"

share|improve this answer
    
Thanks. I ended-up using Google's MX servers, forwarding unknown addresses to my own MX server, and setting-up a separate SMTP server for our website. –  geofflee Jul 6 '10 at 5:41
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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