#! /bin/bash # simply look for the number of messages incoming in a particular day # reads mail.log, looking for some key phrase that only shows up in incoming mail # can be used on source machine to see if any additional mail has come in (though getStats does this better) # and on target machine to see if e-mail is correctly coming in. # note: kind of sloppy if keyphrase is not set right. # change this to some key that will only show up in deliveries KEYPHRASE="deliver" # log file to check LOGFILE=/var/log/mail.log if [ "$1" = "" ] then echo Usage: checkTraffic maildomain else grep $1 $LOGFILE | grep $KEYPHRASE | wc fi