Importing email archive in Maildir format into OS X mail program

I have a large archive of email stored in the Maildir format. I would like to know how this archive of email can be made available within the OS X mail program. I do not yet own a Mac, but am doing research on its capabilities to determine whether and how I can maintain the capabilities I currently enjoy (I currently use KMail on Linux).

This message claims that as of Tiger, the mail program stores ts mail in Maildir format. Is this true?

If his is true, then it would not make sense to convert the archive into mbox format files just to turn around and import the mbox files back into separate files again through OS X mail. There should be a more direct way. What is the best way?

Other OS

Posted on Nov 22, 2006 10:30 AM

Reply
1 reply

Nov 22, 2006 11:52 AM in response to dbhiebert

IMO, you'll need to convert your mdir files in mbox before importing them into mail. I found the following script on osxhints and just tested it with some mdir files I copied from our server.

#!/bin/bash
for file in `find /Users/drfu/{current.mdir,new.mbox}/ -type f`
do
cat $file | formail >> mbox
done

--------------------
I'm not the world's greatest script writer, but I copied the mdir files that I wanted to import to a folder named current.mdir and placed it in the root of my home folder. Then I created the following script and placed it on my desktop:

#!/bin/bash
for file in `find ~/{current.mdir,new.mbox}/ -type f`
do
cat $file | formail >> mbox
done

When it ran it created a file named mbox which I renamed to oldfiles.mbox. Then I opened mail.app, File, Import Mailboxes, Other, and selected oldfiles.mbox. Mail.app imported all messages and attachments into a folder named oldfiles.

If you are not familiar with shell scripts, all you have to do is paste the text of the script into TextEdit then save the file with a .sh extension, (i.e. importmdir.sh).

Next you need to make the file executable. To do this open Terminal, cd to the desktop where the script is stored and type:

chmod 777 importmdir.sh

Then run the script, in Terminal, by typing "./importmdir.sh" (without the ")

- Wayne



PowerMac G5 Mac OS X (10.4.8)

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Importing email archive in Maildir format into OS X mail program

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.