[Gllug] procmail recipe to weed out html from mails

Stig Brautaset stigbrau at online.no
Sun Sep 23 11:36:39 UTC 2001


* Nix <nix at esperi.demon.co.uk> spake thus:
> On Sun, 23 Sep 2001, Stig Brautaset said:
> > # Filter out evil html, and leave a message that it is filtered.
> > # I am forever grateful to Bart Schaefer for this one.
> >:0
> > * ^Content-Type: text/html
> > {
> > 	:0bfW
> > 	| (echo "[html stripped]"; lynx -dump -force_html /dev/fd/0)
> > 
> > 	:0ahfw
> > 	| formail -i"Content-Type: text/plain"
> > }
> 
> Oh, nice. I'll be using that, for sure :)
> 
> > This recipe naturally goes before any of your other entries. I must
> 
> Not quite; after any that do duplicate elimination (via `formail -D' or
> something else).

Eh, I know, but I could not think of any way to say that that was not
too long-winded :)

> > admit that I don't entirely understand the line containg "/dev/fd/0",
> > but it does the job, and I am happy :)
> 
> The /dev/fd0 is pointing lynx at its own standard input, because (at
> least some) lynxes have no `-'-a-like syntax to do that. (For
> portability's sake, it should really be `/dev/stdin', which is a symlink
> to `/dev/fd/0' (and /dev/fd is itself a symlink to /proc/self/fd...) )

aah, so I can use:

| (echo "[html stripped]"; lynx -dump -force_html -stdin)

instead then?

Regards,
Stig

-- 
brautaset.org
Registered Linux User 107343

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list