: s-aliases
# A sample system delivery file.
#
# While Joe is gone, send problem reports to Fred.
# Note that since user delivery files are processed after this one,
#    Fred's user delivery file may direct all such mail back to joe
#    if Fred wants to be difficult. :-)
# Note that a better solution is to use a bug report alias,
#    but this method demonstrates variable delivery based
#    on message headers.

SUBJECT=`header -f subject $HEADER | tr '[A-Z]' '[a-z]'`

for u
do
    case $u in
    joe)        case $SUBJECT in
		*bug*|*problem*)    echo fred ;;
		*)                  echo joe ;;
		esac ;;
    *)          echo $u ;;
    esac
done
