A collection of computer systems and programming tips that you may find useful.
Brought to you by Craic Computing LLC, a bioinformatics consulting company.

Sunday, February 15, 2009

Switching an Email Server to Google Apps

I've been running my own email server on a machine on my network for years. It's been fine but I've never had a good handle on spam (and when your email address is jones then you get a lot of it!), when my DSL goes down so does my access to email and it's just one more thing to look after. Plus recently Hotmail and Yahoo have started treating email from servers behind DSL connections as spam... great...

So I've moved my email over to Google Apps. You can set up an individual account, of course, or you can sign up for their 'Premier' Edition at $50/user/year (which is not bad) or you can use their 'Standard' Edition for free with up to 50 users (and some ads). I went with the latter - here is how you do it:

1: You have an existing domain name
2: You have an existing and operational mail server
3: You access that mail server from Thunderbird, etc, via IMAP

Note that Google does not promote the Standard Edition - but it is there and open to new subscribers. Go to this signup page.

There are three stages:
1: You set up the server on Google Apps and demonstrate that you own the domain
2: You change the DNS records so that your email gets sent to it.
3: You change you mail readers to access the mail on Google

I'm not going to go into all the details as Google's help pages are pretty good. but there are a few things to bear in mind and one really important thing.

Part 1

You can go ahead and set up the Google Apps account without messing with your existing email, at least to begin with. You need to demonstrate that you are the owner of the domain and they give you two ways to do that.

If you have a web server on this domain then you can create a web page called googlehostedservice.html which will include nothing more than a string that they provide - something like google5caf2f0c6ff7e39 - yours will be different. You place that on your site and Google will look for it and verify your control of the domain. This might take a little while - minutes, not hours.

You then need to create accounts for each user that the server will handle mail for. Note that they do not support regular email aliases, which was an issue for me. But you can create accounts for each alias and then forward email to another account. I haven't figured out all the options with it yet.

They give you a test email address that allows you to test things are working before you actually switch the DNS records.

Part 2

Now you switch the DNS records...


Once you do this all your prior email on your server will NOT be available to you. It will still be there but unless you want to use an alternate domain name, you will not be able to access it via IMAP.

So right before you change DNS records you want to go into Thunderbird, or whatever, and select your entire Inbox (and other folders) and copy their contents to one more more Local Folders. This can take a while with large Inboxes.

I did not realize this until too late. I recovered by using an alternate domain name and pointing that to the old server, but if not for that I would have had to reset the DNS to the old server, get the existing mail and then redo the DNS changes.

OK... you've got your existing email stashed away. Now change the DNS MX records as directed by the Google instructions. It can take some time for those changes to propogate and until they do, new incoming emails will still be sent to the old server and so may not be accessible to you. So make the changes when things are fairly quiet.

On a Unix system you can see what the records point to with the command 'dig yourdomain.com mx'

Unless you want to use other Google Aps services, do not change other DNS records - only the MX records.

Part 3

At this point your email will be going to your account on Google. Login to the URL they gave you - something like https://mail.google.com/a/yourdomain.com/ - and try sending/receiving email. It should just work. If not then check those DNS records again and/or wait a while for them to propogate everywhere.

If the web interface to your email is working then reconfigure your email client to access the Google hosted server. Look at their instructions and follow them carefully. You need to change the incoming and outgoing server names to ones at Google and importantly you will need to change the ports that they use as these are not the defaults.

Overall, the change has worked well for me. Google is doing a good job handling spam, I can access the mail from anywhere, I can avoid the ads by using Thunderbird, and I can give up running my own server. It's a win all around. At some point I may upgrade to their premier edition but I don't see a real need to do that right now.

One less thing to worry about... and no, I don't worry about Google...


Unknown said...

Robert, I'm wondering if you are so strong on security and privacy, why do I see in this article that you are moving to Google Apps where Google will have all our communications indexed and cross-referenced? I'm I missing something?

Cindy Marin said...

Hi!!!! i can't access to de mail in http://mail.hotelexsumnistros.com, i changed the mx records and verify the ownership of the domain, but i don't understand why if the status on my Google Apps Dashboard is "active" the email doesn't work . i really apreciate you help with this!thank you!

Robert Jones said...

RichOnRails, Google are doing two things with any email on their system. They check it for spam, which I want them to do, and they pull keywords from messages to serve ads to me when I view messages on the web. If I don't want that I can, and do, use an IMAP client like Thunderbird.

It sounds like you suspect they are doing something nefarious with the data behind the scenes. I don't believe that.

Chapunk Brinkka said...
This comment has been removed by a blog administrator.
Blogger said...

DreamHost is definitely one of the best hosting company for any hosting plans you require.

Blogger said...

If you need your ex-girlfriend or ex-boyfriend to come crawling back to you on their knees (even if they're dating somebody else now) you got to watch this video
right away...

(VIDEO) Why your ex will NEVER come back...

Archive of Tips