[Gllug] procmail recipe to weed out html from mails

Stig Brautaset stigbrau at online.no
Sat Sep 22 23:18:10 UTC 2001


Hi all,

It was nice meeting you all again. Now, back on topic :) 

Since hotmail recently started sending html-mail (without any plain-text
alternative) by default, many of my (now former ;) friends sent me
html-only mails. After lurking the procmail mailinglist for a while I
got the answer I needed. I think someone at the gllug meeting today
expressed their interest in this little hack, so here it is:

# 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"
}

This recipe naturally goes before any of your other entries. I must
admit that I don't entirely understand the line containg "/dev/fd/0",
but it does the job, and I am happy :)

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