#!/bin/bash # $Id: mailcheck.sh,v 1.1 2002/06/18 00:57:56 host8 Exp $ # This script will be started via procmail after arriving mail # It send information about new mail to user's terminal. ttys="`finger $LOGNAME | awk '/^On since/ {print $(NF-2)}' 2> /dev/null`" notify() { echo echo "NEW MAIL in $*" echo } for i in $ttys; do notify "$*" > /dev/$i; done