Search the OSG website:

From NERSP to Gatorlink

Purpose and Audience

This document is intended for those people attempting to move their mail store from NERSP to Gatorlink. There are several ways to skin this cat, so this document will focus on what are arguably the two best methods. You'll likely find that using a mixture of these methods will pay off in saving time and effort.

NERSP's IMAP performance is less than optimal for large mailboxes but is sufficient for smaller mailboxes (less than a couple hundred messages). This being considered the first method should work well for your smaller mail stores, while the second procedure will yield better results for your larger mailboxes (those with more than a couple hundred messages).

Things to consider

Mail Forwarding

The first thing to consider is the status of mail forwarding on the two accounts in question. Many people who have been using NERSP have their Gatorlink mail forwarded to their NERSP account- in other words mail to is automatically delivered to Once you've decided to move away from NERSP the opposite will become desired- mail to will be forwarded to

"Un"forwarding Gatorlink

The mechanics of reversing the flow are pretty simple. The first thing to do is unforward your Gatorlink mail. Go to the Gatorlink Website and use the Modify menu to access your Email Forwarding page. On this page, click the Forward to Gatorlink Mailbox button. You should now see a page saying "Mail forwarding deleted". It takes about 15 minutes or so for this change to take effect, so once mail starts showing up in your Gatorlink mailbox, you can proceed with forwarding your NERSP account.

Forwarding NERSP to Gatorlink

This step is very simple if you're comfortable with the unix command line. All you need to do is login to NERSP and create a file called .forward in your NERSP home directory. This file should contain one line which will be the email address to which you'd like to forward your mail- ie. user@ufl.edu It's that simple.

If you aren't familiar with creating and editing unix files and/or the last paragraph made no sense here's how you can create a .forward that will work:

Example 1. Creating a functional .forward

Log into nersp.cns.ufl.edu and run the following command, customizing the email address portion with your Gatorlink username.

echo "username@ufl.edu" > ~/.forward

Quota

Figure out how much space you're going to need on the Gatorlink IMAP server in order to move your mail successfully. Once you've got an idea of what you'll need get in touch with the OSG.

Method 1: Using your IMAP client

This is probably the simpler of the two methods prescribed to achieve mailbox migration, and it's recommend that you at least attempt to use this method first. If you run into problems with this procedure then give the other a try.

Making it work

The gist of this process is this: configure your email client to access both accounts, then manually copy the messages by dragging and dropping or some other procedure you prefer. That's it.

Steps to move mail using your IMAP client

  1. Setup your mail client (ie. mozilla or outlook) to operate on both accounts using IMAP
  2. Create the folders in your Gatorlink account where the migrated mail will end up
  3. Select the messages you want to copy from NERSP
  4. Drag and drop or copy the messages to their new home on the Gatorlink IMAP server
  5. Once you're sure the operation was successful, delete the old messages on NERSP
[Note]Dragging, Dropping, and Space on the filesystem

Dragging and dropping between mail servers is essentially a copy operation. In other words the old messages are still on NERSP. Once the copy has been successful, please go back and delete all the copied messages from your NERSP mail store. The resulting free space will be much appreciated.

Problems to Expect

As mentioned before NERSP's IMAP performance is pretty horrible for large mailboxes- that's probabaly why you're moving in the first place. Because of this poor performance you may encounter failures while copying mail from NERSP to Gatorlink. If you run into this problem, the second migration method may be your best bet as it doesn't rely on NERSP's IMAP.

Method 2: Using mbox2imap

This procedure requires you to do some work on the unix command line. If you're not familiar with this don't worry. It's a pretty straight forward process and I'll try to cover all the details. At the bottom of this page you'll find some examples of using the mbox2imap script.

How mbox2imap works

Your NERSP mail is stored in mbox formatted text files, and each folder containing mail is actually one of these files. So to move your mail without relying on NERSP IMAP the mbox2imap script reads one of these mbox files and then opens an IMAP connection to Gatorlink in order to place each message on the Gatorlink server.

Since all of your mbox files are located on NERSP it follows that mbox2imap is located on NERSP as well. In order to run the script you'll first need to login to nersp.cns.ufl.edu Once you're logged in type mbox2imap --help. This will print out the usage options for the script. I'll re-explain these options below.

[Note]Finding your mbox files

Your NERSP INBOX is a file called /var/spool/mail/username (where username is your NERSP username). Any other mail folders will be files located somewhere in your home directory. Most people's home directory contains a subdirectory called "mail". Within this directory you'll find the mbox files you're looking for. If you don't find what you're looking for OSG can help you locate these files.

Arguments

In order to do its job, mbox2imap will need to know a few things. Mostly it needs to know which mbox file you want to migrate and the imap folder you want to place the mail in on the other side. Beyond that you can specify which particular messages it will migrate within the mbox file.

mbox2imap arguments

--mbox

This is the path and filename of the mbox file you want to migrate. It should be in the form of a unix path either absolute or relative.

--cyrbox

This is the folder path where the mail will be placed on the Gatorlink mail store. This option assumes your INBOX, so you should enter the path relative to your INBOX with subfolder being separated by a '/' (forward slash). So if you want to place the mail in folder called "archive" you should pass --cyrbox archive. For a subdirectory of "archive" called "work" you should pass --cyrbox archive/work on the command line. If the folder you specify doesn't yet exist mbox2imap by default creates and subscribes the folders in question.

--user

Use this option to specify your Gatorlink username ie. --user joeblow If you don't specify this on the command line, then the script will prompt you for it.

--start

Use this option to specify the number of a message to start with when processing the mbox file ie. --start 27 will start with the 27th message in the file. This is especially useful if you need to resume a previous job. This option is inclusive. If --start isn't specified the script will assume you want to start at the beginning of the mbox file.

--end

This option specifies the number of a message on which to stop when processing the mbox file ie. --end 199 Use this with --start to specify a set of consecutive messages to migrate. This option is inclusive. If --end isn't specified the script will assume you want to process to the end of the file. --end will not work with --range

--range

This will specify how many messages you want to process ie. --range 150. Use with --start to specify a chunk of messages to process. This option will not work in conjunction with --end

--nosubscribe

The default behavior of mbox2imap is to subscibe you to any folder that it creates when moving your mail. This flag will disable that behavior. WARNING: using --nosubscribe will mean that you won't be able to see these created folders with your IMAP client until you manually subscibe to them. It's best not to use this flag unless you know that you've got a good reason to do so.

Usage Examples

[Note]Assumptions

All of the following examples assume that you have successfully logged into nersp.cns.ufl.edu with ssh or the like and that you are running the command from your home directory (~).

Example 2. Basic Usage

This would move the entire mailbox (mbox file) called 'bar' which is located in a subdirectory called 'foo' to a folder called 'archive' in your Gatorlink mailbox. 'foo' is a subdirectory of your home directory- hence the '~/' preceding 'foo' in the file path.

mbox2imap --mbox ~/foo/bar --cyrbox archive

Example 3. Moving to a subfolder

This is just like the first example except this time we want to move a different mbox file, 'personalmail' which lives in our home dir, to a subfolder of 'archive' called personal.

mbox2imap --mbox ~/personalmail --cyrbox archive/personal

Example 4. Moving the first 1000 messages

This can be accomplised two ways- using either the --end or --range options. The --start in the second example is just to demonstrate usage of that option, but it would not be required in this instance as starting at the beginning of the mailbox is the default behavior.

mbox2imap --mbox ~/foo/bar --cyrbox archive --end 1000

mbox2imap --mbox ~/foo/bar --cyrbox archive --start 1 --range 1000

Example 5. Moving the next 1000 messages

Again using both --end and --range options.

mbox2imap --mbox ~/foo/bar --cyrbox archive --start 1001 --end 2001

mbox2imap --mbox ~/foo/bar --cyrbox archive --start 1001 --range 1000