Posted on Leave a comment

Migrate courier-imap e-mails to Outlook

Source Code Icon

Courier-imap stores e-mails in plaintext. This is quite convenient for migrating them to other locations. The default mail storage is located in /var/spool/mail. Recently, I had to migrate a certain amout of these mailboxes to Microsoft Outlook.

Unfortunately, Outlook is not capable of importing plaintext emails by drag-and-drop or via its import/migration assistent. As opposed to Outlook, Windows Live Mail is able to handle the import of emails by just dropping them in the respective folder. But, this only works if the e-mail files have an .eml ending (which is rather poor design, but ok…).

So, in order to import them in Windows Live Mail you need to add the .eml extension to all emails. Fortunately, with the onboard tool offered by most *nix systems you can easily achieve this:

find . -type f -exec mv '{}' '{}'.jpg \;

As always, find recursively iterates over all files and folders and using the -f flag matches all files, and applies the mv command on them, thus adding .eml to them. Now that we have e-mails that also Windows’s apps are able to handle we can just drag-and-drop them in Windows Live Mail. That’s it!

Leave a Reply

Your email address will not be published. Required fields are marked *

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