How can I extract (or kill) MIME parts from composite messages?
While there is nothing inherently very complicated about MIME multipart messages, the problem is not particularly a Procmail problem. You cannot write a Procmail recipe or a sed script which can parse them on its own because the MIME format is — after all — complicated enough to require a bit more muscle than simple regular expressions. Jari Aalto’s Procmail library has a component which attempts to do it anyway. See the Links page for details. You can write your own Perl script to pick apart the messages (recommended: get the Perl MIME module instead of inventing your own wheel) or use a dedicated program such as munpack to handle them. (See the MIME FAQ for pointers.) An unsound thing to do, which people ask about a lot anyway, is to kill all MIME messages. This should be easy (all compliant MIME messages contain a Mime-Version: header) but not smart, because MIME is merely an extension technology, not a sign that the message contains anything in particular that people usually want
While there is nothing inherently very complicated about MIME multipart messages, the problem is not particularly a Procmail problem. You cannot write a Procmail recipe or a sed script which can parse them on its own because the MIME format is — after all — complicated enough to require a bit more muscle than simple regular expressions.