#!/usr/bin/perl -w

# top

print "
<html>
<head>
<title>Email</title>
<style type=\"text/css\">
   body {
      padding: 2em;
      font-family: arial, helvetica, sans-serif;
      font-size: 10pt;
      background: #EEEEEE;
   }
   div.eheaders {
      border: solid;
      border-width: thin;
      background-color: lime;
      padding: 0.5em;
   }
   hdline {

   }
   span.headertype {
      font-style: bold;
   }

</style>
</head>
<body>
";

# skip first line
my $line = <>;


# headers
print "<div class=\"eheaders\">\n";
while (<>) {

  if (/^\n/) {
    print "</div>\n";
    last;
  }

  if (! /^(\S+):/) {
    next;
  }
  
  s/</&lt;/g;
  s/>/&gt;/g;

  # nospam
  s/@/_AT_/g;

  s/^(\S+):(.+)$/<b>$1<\/b> $2 <br \/>/g;

  print;

};


# body
print "<p>\n";
while (<>) {

  s/</&lt;/g;
  s/>/&gt;/g;

  s/^\n/<\/p>\n<p>\n/;

  print;

}

# end
print "</p>\n";

print "</body></html>\n";


