#!/bin/sh
# show the subject and sender of new mails
# written by Michael Lucas-Smith <sain@driftwood.draconic.com>
# this was designed to be used with root-portal 
# this script is under the GPL

cd
if test ! -f ${HOME}/.newmail.old
then
	echo > ${HOME}/.newmail.old
fi

cat /var/spool/mail/${USER} | sed '/From:\|Subject:/!d' > ~/.newmail.new
diff ~/.newmail.old ~/.newmail.new | sed 's/^/>>>/' | sed -n '/>>>>/p' | sed 's/>>>> //'
cp ~/.newmail.new ~/.newmail.old

