########################################################################
#
# mail2html.sed
# Bob Crispen (crispen@hiwaay.net)
#
# Converts mail messages into more or less reasonable-looking HTML.
# You'll still need to do some hand-editing, particularly if your mail
# program won't delete "Received-From:" lines, but at least this gets
# you started.
#
########################################################################
# Turns all quoted lines (using the net convention of ">") to italic
/^>/{
i\
a\
<\/i>
}
# Some really lame web browsers won't take an ampersand in the text
/\&/s/\&/\&/
# Convert "<" and ">" to proper HTML
//s//\>/g
# Any blank line in the text will be substituted with a paragraph marker
/^ *$/s//
/ # Delete the "From" line from the header. Hopefully this won't delete # any lines beginning with "From" from your text. /^From:/{ s///; x; } /^Date:/{ s///; H d } # The Subject: line is the title of the paper and the headline # at the top of the paper /^Subject: /{ s///; s/\&/\&/ i\ \
\\
d; } # If you have at least 5 dashes, substitute an underline /^[- ]*-----*$/c\