My main project these days is, MailTank. Part of the fun is parsing email, and I have written many bits’o email parsing code over the years, in PHP, Java and now Ruby.
Why do so many email clients suck at parsing email? For example, Apple Mail has major issues with presenting readable messages from mailing lists, such as the SPF, Communigate and Ruby Lang list digests.
The issue seems to stem from an inability to handle message/rfc822 mime parts correctly or recursively parse all the mime parts correctly.
Recursively parsing of mime structures is the only solution most of the ills email clients suffer from, with a couple of quirks-like parsing tricks to capture relevant data from mailing lists and flowed formats.
Every developer who deals with email must build of a catalog of email to test against.
A good starting place is here.
