[Gllug] procmail recipe to weed out html from mails

Nix nix at esperi.demon.co.uk
Sun Sep 23 09:25:03 UTC 2001


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).

> 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...) )

-- 
`Upsetting this BOFH was a BAD MOVE.' --- Chris Newport

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




More information about the GLLUG mailing list