Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can I extract (or kill) MIME parts from composite messages?

0
Posted

How can I extract (or kill) MIME parts from composite messages?

0

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

0

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.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.