I use the script below to return email under some conditions. I'd like to
modify it so that if, for example, I am returning mail that was sent from
abc(_at_)xyz(_dot_)net, I'd like to also send a copy to
postmaster(_at_)xyz(_dot_)net(_dot_)
Can anyone show me how to modify the script below to accomplish this?
Thanks!
#! /bin/sh
infile="/tmp/AR-$$.in"
outfile="/tmp/AR-$$.out"
cat > "${infile}"
from=`grep -i '^from: ' "${infile}" | head -1`
if [ "${from}" = '' ]
then
echo "No From: field." > /dev/tty
exit 1
fi
to=`echo "${from}" | sed -e 's/^From: *//'`
if [ "${to}" = '' ]
then
echo "Empty From: field." > /dev/tty
exit 1
fi
echo "To: ${to}" > "${outfile}"
--
Ed Stone
estone(_at_)synernet(_dot_)com