steve [mailto:steve] On Behalf Of Steve Vertigan wrote:
> I'm thinking of writing a perl script to be called from a .qmail file
> that will check a message for html encoding and kill it if it does.
> Partly because I'm sick of seeing html on lists and partly because it
> seems like a good bozo filter.  So anyway before I do pick up my hammer
> and chisel I'm wondering has anyone else here already carved a rock into
> a circumvolution mechanism that does something similiar?

This procmailrc file changes the any multipart/alternative part content type
from text/html to text/x-html.... this causes my e-mail client (Outlook) to
choose the text/plain part and ignore the HTML because it does not recognize
it.

In retrospect, I'm not quite sure why I used sed and not just perl...

[root@w1 /root]# cat ~dharris/.procmailrc

#
# Rewrite mime types on multipart/alternative member messages from text/html to
text/x-html
#

:0 i :
* Content-Type:.*multipart
ALT_BOUNDARY=| sed --silent -e ' /[Cc]ontent-[Tt]ype:.*multipart\/alternative/
b loop; d; :loop; s/^.*boundary="\([^"]*\)".*$/\1/; t gotit; n; /^[[:space:]]/
! d; b loop; :gotit; p; q;'

:0 f :
* ! ALT_BOUNDARY ?? ^$
| sed --silent -e " /^--$ALT_BOUNDARY/ { h; b loop; }; p; d; :loop; n; H; /^$/
{ x; s|\\(\\n[Cc]ontent-[Tt]ype:.*\\)text/html|\\1text/x-html|; p; d; }; b
loop; "
------end-of-file-------

 - David Harris
   Principal Engineer, DRH Internet Services

Reply via email to