News for hackers. Stuff that matters.

Ask YC: Favorite email parsing library?

Any recommendations on a good library for parsing emails in mbox format? I'm pretty agnostic as to language (I don't know Python, but if the library is that good, I will learn it). I mostly care that it takes care of all the language encoding business for me. I've been using the Perl Mail::Box suite, and language encodings with that is just a mess.

Thanks everyone!

( 5 comments | 18 points | on HN )
Re:Ask YC: Favorite email parsing library? by skwaddor on Saturday June 20, 2009 @03:17PM (#666701)
leave the parsing to someone else and use plan9's upas mail file system

http://doc.cat-v.org/bell_labs/upas_mail_system/

http://www.quanstro.net/plan9/nupas.pdf

now available for plan9port on Unix

we don't need no stinking APIs and Libs, give us grep awk sed and cat

Re:Ask YC: Favorite email parsing library? by zeantsoi on Saturday June 20, 2009 @08:49PM (#666998)
Best parser I've found for PHP is the Pear mimeDecode library. Takes a bit of time to figure out the header parsing but it's pretty decent at handling the UW torture test.
Re:Ask YC: Favorite email parsing library? by grandalf on Saturday June 20, 2009 @07:14PM (#666944)
rmail for ruby totally rocks for parsing emails. I haven't used it for the mbox format but I think it can handle it.
Re:Ask YC: Favorite email parsing library? by diN0bot on Saturday June 20, 2009 @03:26PM (#666711)
hmm, i've parsed email before. is there something specific to email encoding than general files? such as parsing the "encoding" header thingy? anything else?
Re:Ask YC: Favorite email parsing library? by uriel on Saturday June 20, 2009 @05:29PM (#666843)
upasfs(4) http://man.cat-v.org/plan_9/4/upasfs

Edit: Damn, skwiddor beat me to it :)