I have an application and need to write a program that is able to figure out attachments from all kinds of email senders (and MUAs) reliably. PHP doesn't seem to have a great MIME parser so I was hoping some other languages might.
I've seen the PHP Mail Mime Parser but it's not robust at all and I know (and have confirmed) it doesn't work reliably with all MUAs.
Does anyone know of a more real-world-hardened mail parsing library?
I can use any language, doesn't matter.
How about Perl 5's Email::MIME? Looks like something that will fulfill Your needs, if I understood You correctly.
I've had some luck with the eZ Components mail library for PHP before.
Python's email
module is excellent and includes full support for MIME emails, including incremental parsing. I think the moral here is that you can do this in many languages.
Of course, you should do it in Python.
Perl has several email parsing libraries, choose the one which suits your needs best.
I have had a lot of success using Ruby and the mail gem at http://github.com/mikel/mail this is now the default creator/parser for Rails.
I think you are really going to get answers from people with their preference of language so I think its ultimately a question of preference but we use this gem in the web front end of CloudMailin.