Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the MX records for set to the Google Apps domains ( etc.). If an email is sent to from most places, it goes to my Google Apps account. However, on the server (Ubuntu 10.04 if it matters), sending via SMTP (postfix), if I send to (via the Pony ruby gem if it matters), it simply routes to kerrick@localhost (showing up via the mail command) instead of going to my Google Apps account (where it should show up in my GApps Gmail inbox).

Can I make email sent via SMTP on my server, through my server, not go to my server but to Google Apps?

share|improve this question
up vote 5 down vote accepted

You either have an entry in /etc/hosts pointing to localhost, like this:

In which case you need to remove this, or you've configured Postfix to treate as a local destination in /etc/postfix/ like this:

mydestination = localhost,

In which case you need to remove this.

share|improve this answer
Ah, I believe it's the second one. If I remove that, can I still send email from via postfix? – Kerrick Jul 8 '12 at 0:36
@Kerrick Yup, that doesn't restrict what From addresses you can use. As an aside, you should however setup SPF records. – mgorven Jul 8 '12 at 3:05
Yay, editing it out of that line fixed it! And I'll look into SPF records, thank you. – Kerrick Jul 8 '12 at 9:19

Your Answer


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.