Migrating email to Gmail


i host a number of client websites on my dreamhost account, along with email.

a few hours of website downtime is not an issue for these clients, and they don’t even notice most of the time, but email is crucial.

dreamhost doesn’t seem like a very reliable service, but low cost, and not reliability is why i switched in the first place. so i’d like to move my client’s email to google apps, and that’s where the problem lies. i have no idea how to go about an IMAP migration.

any ideas?

ps. i know my way around DNS and unix. i just dont know how to get existing IMAP folders/mails onto gmail.


  1. Setup your gmail account – either regular @gmail.com or setup Google apps for your domain, so you get @.com

  2. Using “Settings” in gmail interface, ENABLE imap

  3. Then, from a unix command line at dreamhost, do the following:

Its now going to prompt you twice for password. The first password is for your dreamhost account. Second is for your gmail account.

Note: 1. Look up “man mailutil” in google to see what it does.
2. Depending on the size of your mailbox, it can take a long time. On my approx 5000 email mailbox, it took about 2 hours
3. The IMAP folders from your dreamhost account will end up becoming “labels” in gmail interface
4. You may have to manually move messages between “Sent Items” and “Sent Mail”

I can’t seem to get this to work. For the username, I used email@domain.com for both the Dreamhost and Gmail logins. After I put me password in for my Dreamhost account, I got the following error - warning: rsh to IMAP server timed out

Any ideas what’s wrong?

Do you have a plain gmail account, if so, for gmail the settings are:
imap server is imap.gmail.com

If you have Google Apps account, then your username is user@yourdomain.com

If you are having trouble (“mailutil” can be a difficult program to use, for its lack of verbose error messages), you can try another program, called IMAPSize.

This one is a Windows application. You can use it tod backup your email from one IMAP server, and restore it to another.

There is a mistake in your syntax. Should be like this:

mailutil transfer -merge append ‘{a1.balanced..mail.dreamhost.com/imap/ssl/novalidate-cert/user=}’ ‘{imap.gmail.com/ssl/user=}’

Note: the bracket before ssl after imap.gmail.com is removed.

Thanks for this! It saved me from hell. :smiley: