Question: How do I export my mailbox to another Email account (like Gmail)?
Author: Joseph Tam
Date: Jan 15, 2013
This FAQ is intended for users who are in the situation where they have to
transfer a large amount of Email messages from one Email account to another.
By large, I mean over a hundred, and sometimes, several thousands messages,
possibly spread out over many mailboxes.
- Direct file transfer
Your MathNet mailboxes are stored in mbox format, which is essentially
a text encoding of all your Email, one file per mailbox If the destination
mail account uses the same mail storage format, and you have direct
file access on the other site, you can simply copy your mail files
- IMAP copy using a mail reader
A method that would work well, assuming both Email accounts
support the IMAP remote mail protocol, is to use a mail reader
application (e.g. MacOSX Mail, Thunderbird, Outlook), and add both
your MathNet and other Email account so that both Email accounts can
be accessed simultaneously. Messages can be copied from one mailbox
to another (e.g. drag and drop using GUI mail readers).
- IMAP copy using utility script
A command-line utility is available on our Solaris Unix
workstations (see this FAQ on which
hosts are available) that will automatically transfer all message
via the IMAP remote mail protocol. The destination mail account
must support IMAP for this script to work.
For transfers, you will be prompted for two passwords. The first one is
your MathNet password, the second is the remote Email account password.
# Run without arguments to print help message on its use.
# Check status of email@example.com's INBOX
/usr/local/bin/imapxfer -c firstname.lastname@example.org
# Copy mailboxes INBOX and FromJohn to email@example.com
# - messages will be labelled UBC/INBOX and UBC/FromJohn
/usr/local/bin/imapxfer firstname.lastname@example.org INBOX FromJohn
# Copy all mailboxes to remote account
# - extensive diagnostics
# - prefix mailboxes under MyStuff/
# - the remote user accout is otheracc and the
# remote IMAP server is at server.yyy.com
/usr/local/bin/imapxfer -V -lMyStuff/ email@example.com
You can forward messages from your mail account here to
another account. A side-effect of this operation is that it
will change the From header to your Email address here, and you
won't see the sender without reading the content of the message.
One way you can avoid this is to use pine's bounce command.
If you must forward, it should be empasized that you
should not forward an entire mailbox's worth of messages to the
recipient account at one time. If you have many messages,
this will cause both the sending and receiving mail servers to
process messages as fast as they can, which could swamp one or
Furthermore, if the recipient rate limits incoming mail
(such as Gmail/Hotmail/Yahoo), you could cause the recipient
site to block mail from the sending site which would cause mail
delivery problems for all users.
If you must forward messages, do it in managable batches
(~100 message at a time with a suitable pause in between batches).
Gmail specific instructions
Before you using the remote IMAP methods, you'll have to enable IMAP access to your
- Log in to your Gmail account.
- Settings -> Forwarding and POP/IMAP tab -> Enable IMAP)
Transfers to Gmail via IMAP is somewhat slow. A large mailbox may
take quite a while to fully transfer. Use the imapxfer -v
flag to show the progress of a transfer.
You can optionally create nested labels and present your mailboxes
in the same hierarchical fashion as your MathNet folder layout. To make
do this, you'll have make intermediary labels that corresponds to the
For example, you would need to create