filtering HTML tags from email

Mike Hauber m.hauber at mchsi.com
Wed Feb 23 12:15:05 GMT 2005


On Wednesday 23 February 2005 04:43 am, Simon Barner wrote:
> > > You could also just pipe it to the following:
> > > lynx -localhost -dump -stdin
> > >
> > > Lou
> >
> > Okay, so to be sure, there is no filter (as of yet) to simply
> > open an email file, strip the HTML tags, and resave it?  I'm
> > not complaining, as this may actually be something I'm
> > capable of creating myself.  (I'll make this my first python
> > project. :) )
> >
>
> You probably could do it also with procmail + lynx (or w3m)
> during the delivery process.
>
> Another possibility is to have the following entries in your
> ~/.mailcap file, which converts html, doc and rtf to plain
> text.
>
> text/html; w3m -dump -T text/html; copiousoutput;
> application/msword; antiword %s; copiousoutput
> application/rtf; rtfreader %s; copiousoutput
>
> Simon

Just after destroying the headers in who-knows-how-many emails 
(backed up...  whew!), I finally realized that piping the 
messages though html2text (or lynx or w3m) was probably not such 
a great idea after all.  :)

This is something that really should be implemented as part of 
kmail itself (it would help to remain compatable with both 
maildir/mbox).  I'll continue to be frustrated with html2text for 
a while (it's a pretty cool tool), and who knows...  Mayhaps I'll 
figure out a reasonable way to set it up so that everything is 
done automatically.

Thanks for the feeds.

Mike


More information about the freebsd-questions mailing list