Is there a way to import email from the raw email files?

5

3

I have a client who recently switched hosts. When they switched hosts they didn't backup their email and updated their configuration settings so they lost everything. However, I was able to log in to their old hosting control panel and download their mail folder. I am wondering if there is a way to extract their emails and/or contacts from the files.

I'm not sure what type of files they are, there is no extension, but the folder directory is structured like this:

  • mail/
    • .Drafts/
    • .Sent/
    • .Trash/
    • cur/
    • new/
    • theirdomain.com/
    • tmp/
    • .theiremail@theirdomain.com
    • maildir

Inside of the theirdomain.com folder, there is a folder for each account and inside of that is a folder called "cur" which has a whole bunch of files with names like 1292945327.H169813P25958.uscentral21.myserverhosts.com,S=10117/2,S and if I preview those files I can see the actual email messages inside of them but I have no idea how to get that information from those files to an email client.

Anyone know of a way to work with these files?

Thanks in advance for any insight you can share!

Chris Schmitz

Posted 2011-03-02T22:50:50.113

Reputation: 205

Answers

7

Those folders contain e-mail stored in Maildir format. Wikipedia has a list of e-mail readers that can directly read e-mail in that format, which include the popular KMail and Evolution mail clients.

Most open-source mail server software also supports that format so it should be easy for your current e-mail system to import them. The folks over at Server Fault can help you with that if you give them specifics.

Patches

Posted 2011-03-02T22:50:50.113

Reputation: 14 078

Renaming the files in /cur, adding the extension .eml will enable thunderbird to read them. You can just drag and drop them in then.

http://osxdaily.com/2012/11/22/add-file-extension-group-of-files-os-x/

– vincentieo – 2015-07-21T12:08:14.883

I can add that the standard Mail.app in macOS (presumably also previously in OS X) can also open .eml files as e-mails. – Janus Bahs Jacquet – 2017-03-27T14:34:42.347

This answer worked just like they said – up to a point. The only small glitch I had was that I couldn't find the .sent or .cur files in Thunderbird. But I just renamed the files to *.eml and copied them into the Thunderbird directory via drag and drop and it worked great. – Bob Walter – 2019-02-19T20:17:54.713

@Bob: Not sure what .sent even is, but cur (not .cur) is a directory. It only shows up if you specifically select Maildir format in Thunderbird. – user1686 – 2019-02-20T04:59:19.870

2

What email client/OS are you using?

See if you can import them as per Patches advice. If that does not work, you may end up having to do it manually.

In that case, rename one of the files and giving it an extension of .EML, then open the file. Your default email client should run and open the file, displaying the email message. Once you’ve confirmed that it works, you should be able to drag-and-drop the .EML file into your email client and view it as normal. Then you can iterate through the folders, renaming the files to give them the extension, selecting them all, and dropping them into the client. Then you can sort them, or sort them as you drop them in.

Of course you will want to help reduce the amount of manual work, but for example, using a batch renaming tool (I like Cylog’s WildRenname). Also, you could reduce the amount of manual work by using a macro tool to automate repetitive actions like key presses or mouse clicks.

Synetech

Posted 2011-03-02T22:50:50.113

Reputation: 63 242