#! /bin/sh cat - > /tmp/mail.$$ if [ -s /tmp/mail.$$ ] then if grep '^Received: .* for <.*@spade.com' /tmp/mail.$$ > /tmp/addr.$$ then user=`sed -e 's/^Received: .* for /dev/null then echo "Mail for spade" wc /tmp/mail.$$ deliver spade < /tmp/mail.$$ elif grep '^From foo@bar' /tmp/mail.$$ > /dev/null then echo "No mail" else echo "Default mail for spade" deliver spade < /tmp/mail.$$ fi fi #rm -f /tmp/mail.$$ /tmp/addr.$$