A week or so ago I decided I wanted to get all of my archived mail from Mac OS X's Mail.app into a more readable format. I was a bit surprised to find that ever since 10.4, Mac OS X stores its mail in an Apple-invented format called "EMLX" (well, this is what I'm calling it at least...each mail message is stored in a file that ends in ".emlx"). A very rough sketch of the file format:
- The first line of the file (beginning of the document to the first linefeed) is an ASCII-encoded number representing the size of the actual email message in bytes.
- Starting with the first byte after the linefeed is the email, exactly N bytes in size where N is the number of bytes specified in #1.
- From the end of the email message to the end of the .emlx file is an XML-encoded Apple PList containing metadata about the email message (presumably for spotlight).
I really don't care for the .emlx file format. The only application that's able to read it is Mail.app. Really the only reason for its existence is because Apple w