Listing 4. daysumm Script

#!/bin/sh
mailto="admin@domain.com"
timestamp=`date '+%A - %B %d, %Y'`
etc="/var/spool/smtpd/etc"
date=`date '+%m%d%Y'`
email_total=`cat $etc/email-log.$date`
virus_total=`cat $etc/virus-log.$date`

mail -s "DAILY E-MAIL SUMMARY" $mailto <<eoi

        Date:         $timestamp
        E-Mail total: $email_total
        Virus total:  $virus_total

eoi

/usr/sbin/sendmail -q

exit 0