[ I tried posting this a couple of times before, but it never showed
up, maybe because the message was too long with source code
enclosed. ]
There's considerable demand for a tool that will strip out the HTML
portions of multipart messages and leave only text/plain, but as far
as I can tell, no such tool exists. So I wrote one. Get it at
http://www.rootsweb.com/~twp/unhtml.c.
This program reads a message on standard input and prints a demangled
version on standard output. If the message has a content-type of
`multipart/alternative', the body is discarded and replaced with the
first text/plain subpart that can be found. If the message isn't
multipart/alternative, or if it contains no text/plain subparts, the
original message is passed through unmodified. For example, it can
easily be hooked into SmartList in rc.local.s00 (and .r00):
:0 wf
* ^Content-Type: multipart
| unhtml
It is not guaranteed to be bug-free and should be considered beta
software, at best. For what it's worth, it's been running in
production on RootsWeb's mail servers for several days (an excellent
torture test) and the initial bugs seem to have been shaken out.
Anyway, I give it unto the world for them what wants it. Corrections
and fixes welcomed.
--
Regards,
Tim Pierce
RootsWeb Genealogical Data Cooperative
system obfuscator and hack-of-all-trades