Instructions

These are instructions how to import messages held in KMail 2 into Thunderbird. Versions were KMail 4.10.5 and Thunderbird 17.0.8, but should not matter for this to work.

  1. Install ImportExportTools in Thunderbird.
  2. In Thunderbird, create a folder into which you want your e-mails imported. This can be in "Local Folders", which is recommended, but also in an IMAP account. In the latter case, importing and uploading are done at the same time, so there are two error sources and the second step can not easily be repeated when it fails, without repeating the import step as well.
  3. Right-click on the new folder and select "ImportExportTools -> Import Messages".
  4. In the file selection dialog, go to ~/.kde/share/apps/kmail/mail/<your folder to import>/cur/, select "All Files" in the file filter at the bottom, and select all these messages (simplest by pressing Ctrl+A).
  5. After the import, all messages are marked as unread. Right-click the folder again and select "Mark folder as read" to fix this.

This should import all messages nicely and without errors. You may compare message counts to those in KMail.

Discussion

The above solution seems quite straightforward, but it really was the only working solution I found. Various other solutions are meant to work, but did not:

  • Uploading local e-mails to an IMAP folder in KMail, then downloading again from there in Thunderbird. Should work usually, but in other cases errors in KMail can be triggered. For example, creating a new folder is not possible in KMail if the e-mail server is based on courier.
  • Selecting a bunch of e-mails in KMail and right-clicking on them then selecting "Save as …" gives the option to save them all to one .mbox file. Which can then be imported with "ImportExportTools -> Import Mbox files …" in Thunderbird. However that import often fails, so that no e-mails are imported at all.

5 thoughts on “How to migrate e-mails from KMail to Thunderbird?

  1. I have few folders listed and Inbox has no files. I believe my folders and messages are hidden away in akonadi or some such place.

  2. I find that if I use the archive feature on a Kmail2 folder, it creates an archive file with the messages that I can extract into a folder hierarchy. I am now going to try adding an eml extension to the file names of the messages and see if they can be imported into Thnderbird.

  3. Gord, thanks for sharing your solution. For those wanting to keep with the “renaming to .eml” solution, there’s a more comfortable one-command way of renaming them: go into the directory with the e-mail files, then execute:
    for file in *; do mv "$file" "$file".eml; done
    (Not tested though, should work but test it first.)

    For the problem of not finding your e-mail files in the KMail folder: I think they are in subfolders, which are named as hidden files (starting with a dot). So just enable seeing hidden files in your file manager, and you should find them there.

  4. Thanks a lot! … import was easier than setting up the broken kmail again.

    Rename was not necessary. There is a combo-box to just show “all files”. They reside in sub-folders like “cur” or “new” thought the assignment to those folders is completely bogus and does not reflect any new status those messages may have had before.

    Now I only need to resurrect the regular expressions I used to filter my inbox.

Leave a reply

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>