For ages1) I have been using a Perl script called
demime written by Nick Simicich in order to remove attachments and HTML from message, e.g. for mailing lists or my personal archiving.
demime still works astonishingly good but it does have its quirks, and it is rather radical in what it does. Hence, I was always looking for alternatives.
Recently, I came across
remove_mime.pl by Aaron Ciuffo which is based on a script
by Mike A. Leonetti. Eventually, these two encouraged me to write my own script: attachment_filter.pl
A crude summary of what I have found so far on the Perl side:
demime.plby Nick Simicich: 15 years old and still rocking!
lynx; almost no dependencies; not for the faint of heart. Unfortunately, the original link http://scifi.squawk.com/demime.html is not available anymore, but feel free to download my copy: demime_1.1e_as1.pl
remove_mime.pl; also only depends on Email::MIME; includes instructions of how to use with Postfix; sends autoreply to sender if attachments have been removed.