#!/bin/sh
#
# mailwrapper.sh -- send SMA HTML report via email
# NOTE: requires "IncludeAscii yes" (cmd line: -i)
#
# Usage: mailwrapper.sh < report-with-ascii-comment.html
#

# Mail headers
FROM=from@example.dom
TO=to@example.dom
SUBJECT="Sendmail log analysis"

# Sendmail command line
SENDMAIL="/usr/sbin/sendmail -t $TO"


(
echo From: $FROM
echo To: $TO
echo Subject: $SUBJECT
echo
sed -n '/<!--/,/-->/p' | egrep -v '^<!--|^-->'
) | $SENDMAIL

