#!/bin/sh
# Change completely text/html messages to text/plain

PATH=/bin:/usr/bin:/usr/local/bin:/opt/local/bin:$PATH

MAILFILE=/tmp/nohype.$$
cat "$@" > $MAILFILE

cat $MAILFILE | sed -e '/^$/,$ d' \
    -e 's,^Content-[tT]ype: text/html,Content-Type: text/plain,' \
    -e '/^Lines:/ d' -e '/^Content-[Ll]ength:/ d' \
    > $MAILFILE.head

cat $MAILFILE | sed -e '1,/^$/ d' > $MAILFILE.body
lynx -force_html -dump $MAILFILE.body | cat $MAILFILE.head -

rm -f $MAILFILE $MAILFILE.head $MAILFILE.body
