Uploading old email to new IMAP account…the fast way!

I nearly titled this “Uploading old email to new IMAP account…the easy way!”, but I’m afraid it might not be “easy” to those of you who haven’t had much experience using command line based programs.  I certainly prefer the GUI, but after hours of trying to get Thunderbird to upload the email, I gave up.  The task before me was to upload about 19,000 emails from my boss’s old computer to our new email server hosted with RackSpace Apps.  Most of the commands here can be used to import email into RackSpace Apps with very little change, but can also be adapted to import email into gmail as well.

Step 1 – Download this email upload python script from sourgeforce and download ActivePython.  ActivePython is a bit easier to install than the default Python because it automatically configures the command line stuff, which is why I recommend it in this tutorial.

Step 2- Extract the .zip file.  Make sure to copy the file path as seen in the screen shot, this will make the next command line steps easier.

Step 3- Open a command prompt.  Go to Start->run and type “cmd” then click OK.

Step 5 – Navigate to the folder the python script is in.  You can do this by typing “cd ” (include a space) and then right clicking and pasting the file path you copied back in step 2.

Step 6 – Locate your MBOX file and copy it into the python script directory.  You can leave it where it’s at (obviously), but I’m writing this to be as easy as possible.  Click here for directions finding your Thunderbird mbox file.

Step 7 – Run the following Python command, replacing “example.com” with the address of your IMAP server and then enter your username and password when it asks.   It took 5 or 10 minutes to get past the “Counting the mailbox” screen for me.  Takes a while longer to finish the upload, especially if you’re like me and have almost 2GB of email you have to upload.

  • python imap_upload.py –host secure.emailsrvr.com –port 993 –ssl –box imported inbox.mbox

3 thoughts on “Uploading old email to new IMAP account…the fast way!

  • November 9, 2014 at 1:15 am

    Do you think this will still work?

  • December 28, 2015 at 1:51 pm

    For those wondering (like Sean) if this still works – YES! The latest version of the script on SourceForge needs a slightly different set of parameters, though. Here’s what I used:

    python imap_upload.py INBOX.mbox imaps://secure.emailsrvr.com/INBOX

    Then it asks for your username & password and it’s good to go.

  • August 9, 2016 at 4:33 pm


    I appreciate the updated syntax for correctly using this program. I can confirm it works beautifully using your parameter set.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.