procmail
[Top] [All Lists]

modifying this shell script

1996-09-23 17:57:32
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

<Prev in Thread] Current Thread [Next in Thread>
  • modifying this shell script, Ed Stone <=