How to upload an mbox file to an IMAP server

imapmboxupload

I decided to play with Mutt, and after quitting discovered that it had moved all the mails from my IMAP server to a local mbox file. I would like to put those mails back in the IMAP server. Is there an easy way to do this?

There are a couple of things that I am worried about:

  • The mails are mostly in UTF-8 or ISO-2022-JP. I am worried a primitive tool that parses the mbox file will garble this up.
  • I have several folders under the main inbox folder in the IMAP server, which Mutt apparently did not see. I am worried that a tool that uploads the mbox file will smash the other folders.

Best Answer

It is a two-step procedure:

  1. Import the mbox file into a local email folder
  2. Then move (or copy) the newly imported emails to the imap folder

In my case I used Mozilla Thunderbird with the already mentioned ImportExprtTools addon. The latter supports importing mbox file into local folders. The former supports moving emails from one email-account to another, thus uploading locally stored emails to the inbox-folder of an imap account.