Re: Parsing Mail's .emlx message format
Re: Parsing Mail's .emlx message format
- Subject: Re: Parsing Mail's .emlx message format
- From: Nir Soffer <email@hidden>
- Date: Fri, 12 Jan 2007 16:54:40 +0200
On Jan 12, 2007, at 11:21, Philip Dow wrote:
I'm looking for information on extracting the textual and/or html
contents form a given .emlx Mail message file. Actually, I'm
looking for a parser that's already coded.
I've searched google high and low for this as well as the list
archives. I have managed to find a few, stray perl scripts, but I'm
looking for a cocoa/carbon solution, preferably the former. Does
anyone know if this has been tackled before, or if a seldom used
Apple framework can parse the data for me?
The file is just a text file following a specific structure, and
I've had some success parsing it myself. But I know I'll never be
able to offer more than a hack job once I get into the business of
dealing with message text encodings and multipart content. Better a
solution that already works rather than me re-inviting the wheel
and coming up with a triangle.
I would try to get the message text from Mail itself through
AppleScript - this will be more robust then building on mail private
format.
However, if AppleScript solution does not suite your use case,
parsing emlx looks quite simple.
The format looks like:
1. The first line contain the original mime message length, starting
at the next line
2. The mime message itself
3. Some plist - trivial to use.
So all you need is a standard mime parser. I would use Python for
such job <http://docs.python.org/lib/module-email.html>. If you want
Objective C solution, there is Pantomime framework <http://
www.collaboration-world.com/pantomime/>.
Best Regards,
Nir Soffer
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden