Converting Email Files (.eml) to Thunderbird Maildir

After a lot of effort trying to figure out how to get some of my email into Thunderbird, from simple email files, I finally figured it out. I couldn’t do some of the other suggestions, as I have a lot of mail. Hopefully this saves you some pain too.

You’ll need to install these tools under Linux. ¬†For Debian variants, that’s the following two packages.

  1. maildir-utils
  2. getmail4

Follow these steps, and you should have your mail in Thunderbird’s local folders.

  1. mu mkdir maildir
  2. find Inbox* -name ‘*.eml’ | while read -r mail; do echo “$mail”; cat “$mail” | getmail_maildir ./maildir/ ; done
  3. Make a maildir folder in your thunderbird Local Folders.
  4. rsync -av maildir/new/ ~/.thunderbird/xen72crz.maildir/Mail/Local\ Folders/Inbox/cur/
  5. Right click folder in Thundebird -> Properties -> Repair Folder

Keep in mind that the ‘/new/’ on the #4 line may be ‘/cur/’; I’ve seen it be either, not sure why.

One Reply to “Converting Email Files (.eml) to Thunderbird Maildir”

  1. There are some mistakes:

    In the first step, you are creating a maildir named ‘maildir2’, but in the second step you are using ‘maildir’ as target directory.

    The second step didn’t work either (e.g. with spaces in the filenames). The command I was using:
    find Inbox -name ‘*.eml*’ -print0 | xargs -0 -I {} sh -c ‘cat “{}” | getmail_maildir ./maildir/’

Leave a Reply

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