Empire of the Iguanadons

Leave your political correctness at the door.

Ubuntu, Postfix, and Gmail Relays

The Problem

You have a shiny new Ubuntu server (like mine - thank you anonymous benefactor) and you need the system to be able to send mail. You DON'T need it to accept mail for your domain though because, like me, you're using Google Apps to do that.

The Solution

Getting this to work isn't terribly difficult, though it is linux, so be prepared for even this to go horribly wrong. Because it did for me. Spare yourself the hassle of spending your day on Google reading forum posts from 2004 that have no solution. Just don't do it.

Also, on the off chance it's now 2027 and you just found my blog page after searching for a solution for 3 days, this was done on Ubuntu 12.04. Sorry future boy, but this probably won't help you much on Ubuntu 73.3

Next, configure Postfix. Every guide I've seen says to set it up as "internet server" so go with that. Follow the prompts you're given, if you're lucky enough to see them - because I wasn't. So don't be surprised if it "just happens" and you're left at the command line wondering why it's not doing what you thought it should.

You can try sacrificing a goat, assuming that's still legal in 2027. If not, try sudo dbpkg postfix reconfigure

Now you need to modify the default configuration file to match up with your Gmail setup. In /etc/postfix/main.cf, add the following section:

Change the "user.name" part to your actual username on Gmail, and change the "gmail.com" part to your domain if you're handing it there. Otherwise leave it as "gmail.com" if your'e trying to relay through a regular Gmail account.

Once the file is saved, change the permissions on it so that evil hackers can't snoop the data:

This last bit is the critical component, the one that stymied me for hours, and the one that NO OTHER GUIDE has ever mentioned. If you're *NOT* going to be using your Postfix server to receive mail on your domain, you need to change one line in the /etc/postfix/main.cf file:

The "mydestination" line, which should be changed to read as this:

mydestination = localhost

Now restart Postfix:

sudo /etc/init.d/postfix reload

You should be good to go now. If not, then I really feel sorry for you folks in 2027. Linux obviously hasn't gotten any easier to work with!........................."It is pointless to resist, my son." -- Darth Vader
"Resistance is futile." -- The Borg
"Mother's coming for me in the dragon ships. I don't like these itchy clothes, but I have to wear them or it frightens the fish." -- Thurindil

Also, on the off chance it's now 2027 and you just found my blog page after searching for a solution for 3 days, this was done on Ubuntu 12.04. Sorry future boy, but this probably won't help you much on Ubuntu 73.3

Thanks for the walk through, Samson, I think I can use that even though my box keeps telling me it doesn't have space to upgrade to 12.04 (what's wrong with the totally blank 125gb partition, I have no clue, but...).

Having raised both goats and chickens here, I can assure you that it takes considerably more than two chicken to make up for the mass difference. A LARGE chicken might weigh in at 3-5 pounds, a small goat will weigh in at 25-30 pounds.. you do the math! ...now, if we were talking about productivity difference, you might need several goats to equate to a single egg-layer, but we were talking about mass.

The opinions expressed here are mine, and those of the people who respond.
If you disagree with what we've said, speak up! Participate in the debate!
The Imperial Guard has expelled 10612 filthy spammers from the Empire. Bastards.