Bounce Your Amherst Email to GMail

 

A New and Better Way

https://cms.amherst.edu/offices/it/network/email/gmail

Amherst IT (thanks Devindra!) has written up instructions that let you drag and drop your old e-mail messages into your GMail account using Thunderbird or Mac Mail and the wonders of IMAP.  This is a better solution, doesn't require the command line or bouncing thousands of messages, and I strongly recommend it over the long approach described below. 


 

The Old-Fashioned Way 

[The old way should still work in case the new and better way doesn't, so I leave it here for reference.  The new and better way above is way less scary and way more sensible, so I strongly recommend it over this one.]

So you've just graduated from Amherst College, and you're living in fear of the October 15th deadline when your Amherst email will stop working. And so you want to move all of your email to your GMail account so that your last four years won't be lost for all eternity.

In that case, this tutorial isn't really for you. If you want to back-up your Amherst email so that it's not lost for all eternity, you should back up your Personal Storage Folder from Outlook. If you're off-campus as most of us are now, you can actually archive your email online. That link gives directions on how to download a .pst file from the Amherst website -- it's slow, but it works, and it's the best way to back everything up (you can open it later using Outlook, or, with a little work Thunderbird or some other email program). I strongly encourage you to download that archive file to your computer before you mess with the instructions I'll describe below.

In fact, while you're at it, you really, really ought to look at the entire page that IT has created for graduating seniors. It describes lots of useful tips for email stuff, and also has a long list of other computing chores that you really, really want to take care of this summer while you're bored (and before it's too late). (But if you haven't started forwarding your Amherst email to your GMail account, don't do that until after you've finished this page of instructions.)

OK, but maybe you still (after having backed up your email) want to bounce all your email to GMail. You want to have everything in GMail because your GMail account has a huge amount of space and does a really good job searching everything and you want everything in a single place that you can quickly access from any computer in the world connected to the Internet. To do this, we'll "bounce" your email to GMail ("bounce" rather than "forward" because we want to keep all the information about who sent it and who they sent it to and the date they sent it, and so on).

Do not bounce all of your email to GMail at once. Follow the directions painstakingly deliberately described below to only send 2000 messages at a time.

Login to Romulus Using SSH

The first step is to login to the Romulus UNIX server at Amherst College using a Secure SHell (SSH). This part is different for Mac users than it is for PC users, but once you get this figured out, then we're all just using UNIX and the instructions are all the same.

Login to Romulus using SSH from a Mac (running Mac OS X)

It's easy for Mac users, of course. Open the Terminal application inside the Utilities folder (itself inside the Applications folder, which is just in your hard drive). This should bring up a white box with black writing (including the text "Welcome to Darwin!"). Welcome to the command line interface to your Mac.

The SSH program is easily accessed using the ssh command. To login to Romulus, type the following (the green) after the prompt (the black):

nick$ ssh npdoty@romulus.amherst.edu

(Of course, you'll want to use your regular Amherst username instead of mine (npdoty) and the prompt in your terminal window will probably be your username on your computer instead of mine (nick).) When you do this, you'll probably be told that the authenticity of the host (this should be listed as 'romulus.amherst.edu (148.85.1.65)' -- if it isn't, you might be under attack, so don't continue!) can't be established, but type yes and hit enter to continue connecting. Then you'll be asked for your password: type in your regular Amherst password and hit enter.

At this point, you should be presented with a new prompt on Romulus that looks like this:

[npdoty@romulus ~]$ 

Congratulations! You've logged on to Romulus.

Login to Romulus using SSH from a Windows computer

This is a little more difficult than it is from a Mac, but it's totally doable. You probably don't have an SSH client on your machine (like all Macs do), so you'll need to download one (if you do have your own, you're welcome to use it -- the instructions below should be easy to modify to your particular client). One of the best (and one that's free) is PuTTY. So, use your favorite browser to go to the PuTTY download page and download the latest version of PuTTY. There are a lot of links on this page, so it might seem confusing but it's really not: click the first putty.exe link that you see ("For Windows 95, 98, ME, NT, 2000 and XP on Intel x86" which very probably describes your system). Once the PuTTY program has finished downloading (maybe you saved it to your desktop), double click it.

This should bring up a dialog box (if it doesn't, I'm not sure why -- make sure the download really worked, or check out the PuTTY online documentation). For the Host Name, fill in romulus.amherst.edu and for the Protocol, select SSH. (The Port should automatically be set to 22 when you choose SSH.) Then click Open.

Then you'll probably get a message about the server's host key. Just click Yes here (or click No if you want to be cautious, but don't click Cancel or you won't be able to continue).

After this you'll need to login. Fill in your regular Amherst username and password. And if that works, you should be presented with a prompt on the Romulus server that looks something like the following:

[npdoty@romulus ~]$ 

Congratulations! You've logged on to Romulus.

Login to Your Email Using Pine

Run the UNIX email program PINE (Pine Is Not Elm):

[npdoty@romulus ~]$ pine 

Now, not much will change on the screen, but you will be given towards the bottom a prompt to login:

HOST: exchange.amherst.edu ENTER LOGIN NAME [npdoty] :

If the username you want to login with is inside the brackets, you can just press enter. Otherwise, type your username and press enter. Then, when it asks for your password, enter your regular Amherst email password (don't worry when no characters appear on the screen as you type, that's a security measure) and press enter. Then, you should be presented with a menu on which you can get help, compose a message, see the message index, the folder list, the address book, etc. Also, at the bottom, you should be told that

[Folder "INBOX" opened with 8,177 messages]

Except with however many messages you have in your inbox. Press the i key, and you should be presented with a list of messages from your inbox. Congratulations! You've logged on to your email the old-fashioned way.

Create a Filter in GMail

Now, it's time to take a step back from all the hard-core, command-line stuff, and set up your user-friendly, web-based companion GMail to accept the huge number of messages it's about to receive from Pine. How exactly you'll want to do this will depend on how your email is organized now and how you'll want it organized in your GMail account. I'll give one reasonable example case in these directions: all of your email now is in your Amherst inbox and you want it all archived (not unread or in your inbox) in GMail. But if you want to not archive the mail as it comes in, or you want to divide it up into folders (labels, in Gmail), that's easy to do by either ignoring the following instructions (so that nothing gets archived), or repeating and modifying the following instructions (once for each label/folder).

(A brief comment and warning for those who just want everything in their inbox. You don't need to create a filter like this at all, but there are some drawbacks to having everything unread in your GMail inbox. First of all, your unread count in GMail will be huge until you manually mark everything as read (you can do this 100 at a time by using the select all function in GMail, but it's still a pain if you have several thousand messages). Secondly, your email won't necessarily appear in your GMail inbox the way it was in your Amherst inbox. It probably will appear in that order, or roughly that order, but Pine will make you no guarantee. GMail sorts mail in your folders by the date and time that GMail received the message, even though it will tell you in the details of a message when the message was originally sent. Pine will probably send your emails to GMail in the order it received them, but maybe not.)

If you don't have a GMail account already, sign up for one. Amherst graduates often try to get their Amherst usernames @gmail.com, and generally have success doing so. So for example, I'm npdoty@gmail.com. You might want to have a separate GMail account than the one you're using right now (or you might not) since we'll be dumping a whole lot of email in it very soon.

Click Create a filter at the top of your GMail, next to the Search the Web button. This will turn the top part of the GMail page into a orange box with several fields in it. In order to create a filter that will match all messages, add the following to the Has the words: field:

p OR -p

(Those of you who know logic should get the joke.) All messages either have the letter p or don't have the letter p so this filter will match everything that comes in while it's activated. You can click Test Search to test this if you want, but otherwise, click Next Step >> to continue. Check Skip the Inbox (Archive it) if you want to archive all of these messages. (Of course, if you wanted to label all the messages about to arrive from a single folder, say, you could check Apply the label: here and select the appropriate label.) Finally, click Create Filter. You should now be given a list of filters applied to incoming mail (and there should be only one).

A couple things to think about regarding this filter: this will archive everything that arrives at your GMail address in the next hour or two that it'll take you to bounce over all your email. If your friends frequently send you messages to your GMail account, it's possible that you'll miss a message from them (it'll be in your email, but you won't notice it, because it'll be archived in the middle of all your Amherst email). There are a couple ways to avoid this: first of all, you can just do a search at the end of this process (after you've deleted this rule) for all mail to:npdoty@gmail.com (or whatever your GMail address is). This should show you all the mail you've received directly to GMail and filter out all of the bounced Amherst email. This isn't guaranteed to get all the email you might be receiving though, because occasionally email is sent directly to you even when it's delivered directly to your GMail account (because you were only CCed or BCCed on the message, say or because it was sent to a mailing list that you're on rather than actually to you). If you're worried about this, you could change the above filter so that rather than archiving all messages, it archives messages that are addressed to your Amherst email address (In the Create a Filter box, set To: to npdoty@amherst.edu and forget all the p OR -p stuff). This will leave you with a bunch of Amherst messages that aren't archived, but you can go through these and archive them without too much trouble. (Obviously the original method works best if you're using a fresh GMail account.)

"Bounce" Your Email

OK, head back to Pine. You should have your Inbox open (or whatever folder you want to bounce) with a long list of messages in front of you. If you got logged out somehow in the meantime, repeat the first two sections of this tutorial so that you're logged into Romulus and you're logged into your email using Pine.

This is extremely important. Do not bounce all of your email to GMail at once. Doing so will wreak havoc on your GMail forwarding process and on the email habits of everyone at Amherst by convincing Google that Amherst College is a spammer. Please follow the directions below to only send 2000 messages at a time and take a half-hour break between chunks.

Now, select the first chunk of 2000 messages. To do that, type

;n

At this point you should be asked for a comma-delimited list of numbers. Just enter the first range of 2000 messages that you'd like to bounce and press enter.

1-2000

If the selection worked, you'll then be told that:

[Select matched 2,000 messages!]

(Unless you have less than 2,000 messages in this folder, or you're trying to bounce more than 2,000 messages at a time, explicitly counter to these instructions, or if something went wrong.) Of course, if you're working on the second, third or fourth chunk of your inbox, you'll want to enter 2001-4000 or 4001-6000 and so on. For the last chunk, which will be less than 2000 messages, you'll have to enter in something like 6001-7042: up to whatever the number of messages in the folder is (you can always see this in the top right corner). Now, apply a bounce operation to those selected messages by typing:

ab

And now enter your GMail address (don't forget to replace mine with yours -- I don't want all your email!):

BOUNCE (redirect) 2000 messages to : npdoty@gmail.com

And press enter. And then press y to confirm that you want to send it (this is your last chance to back out). Pine will then tell you that it's "Sending mail" and it'll keep telling you this for a long time. It could take up to an hour or more to send 2000 messages (though it'll probably be considerably less, more like 15 minutes).

Wrapping Up

Once all of your email has been bounced to your GMail account (and you've confirmed this using your web browser), you'll want to quit Pine. You can do this just by typing q. Then type exit to logout of Romulus. Quit Terminal or PuTTY. In GMail, you'll probably want to delete the filter that you created to archive all emails that are received so that you don't miss anything new (Settings, Filters, delete). You'll probably want to forward your Amherst alumni address email to your GMail account and forward your Amherst email to your Amherst alumni address (two forwards like this is fine, and probably the best way to do it). You might want to email me to heap praise on me or to complain about how a specific part of this tutorial didn't work.


Variations on a Theme

You shouldn't need all the information below, but it provides some slight variations on the above instructions, in case you're trying to bounce multiple folders, you already have a lot of Amherst email in your GMail account and don't want to duplicate everything, or you're too scared to use this command line stuff and would rather use Thunderbird (a program with a "normal" graphical user interface). Let me know if there are other variations that you'd like described here.

Handling Folders

If you've actually been organizing your email, then you'll probably have multiple folders that you need to bounce from Pine to GMail. This adds a few extra steps, but it's not hard. I don't know of any way to bounce all your folders all at once (and you probably wouldn't want to anyway), so we'll just repeat the above steps for each folder. Before you bounce a folder, you'll probably want to slightly modify the rule we created before. In GMail, click Create a filter and then Show current filters. Then click edit next to the filter you have that archives everything that arrives. You don't need to change the search criteria, so click Next Step >> and then check Apply the label: (and choose a label appropriate for that folder you're about to bounce) and finally click Update Filter.

In Pine, you can see the list of folders by typing l (that's an 'el') at the main menu. You can move around the list of folders using the arrow keys, and hit enter (or >) to see the contents of any folder. Inside any folder you can follow the same directions for selecting and bouncing messages. If you have less than 2000 messages in a folder (you can see the total in the top right of the window), you'll want to enter 1-XX where XX is the number of messages you have as the number range to select. Once you're done bouncing a folder, you can get back to the folder list by typing <. Don't forget to change your GMail filter between each folder!

What To Do If You've Already Been Forwarding Email to GMail

A lot of us have been forwarding our Amherst email to our GMail accounts all along (and occasionally or exclusively using GMail to respond). If this is your case, you won't want to bounce all of your Amherst email to your GMail account, or you'll duplicate all the Amherst messages currently in your GMail account. This is mildly tricky. What you'll want to do is find the first Amherst email in your GMail account (probably by clicking Oldest in your Inbox) and then find out what number that is in your Inbox in Pine. (A couple hints on doing this in Pine: j will let you jump to a specific number; also you can select messages based on date by typing ;d, after you do this, type z to jump to the first message in that selection.) But once you know this number, you can just follow the directions above and only select up through this number.

I can't really decide if you should stop your Amherst email forwarding while you're in the process of bouncing all your old Amherst email. On the one hand, if new Amherst mail comes in, it'll be hard to find (you can't search based on the email's being addressed to your GMail address), but on the other hand, it won't get bounced over in this process since you're intentionally not going to bounce the most recent messages. But this really shouldn't be a very big deal either way.

Using Thunderbird and the Google GMail Loader

If you're really scared of using the command line and Pine, you might be able to achieve a similar effect using Thunderbird and the Google GMail Loader (GML) program. I haven't tried this, so I don't know how well it works (or if it works at all for that matter) but it seems to use a similar principle to what is described above (and the advice about GMail filters might still be useful). To do this you'll probably need all your email already in Thunderbird, or that backup .pst file you downloaded earlier.

How to Import Archived Outlook Email Into GMail Using GML