Scrip Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



im seting up a scrip pipe for postfix + spamassassin as a filter in
postfix. 

this really works how ever i have a prb with the FWD depending on the
recipent, can any one help me with this line

if $EGREP -q -i "To: *kav@xxxxxxxxxx*" < /var/tempfs/out.$$

how can i tell egrep to check for any format of To: in the email heder.

===================

SENDMAIL="/usr/sbin/sendmail.postfix -i"
EGREP=/bin/egrep

EX_UNAVAILABLE=69

SPAMLIMIT=5

trap "rm -f /var/tempfs/out.$$" 0 1 2 3 15

cat | /usr/bin/spamc -u filter > /var/tempfs/out.$$

if $EGREP -q "^X-Spam-Level: \*{$SPAMLIMIT,}" < /var/tempfs/out.$$
then

KEV=kalinga@xxxxxxxxxxx

if $EGREP -q -i "To: *kev@xxxxxxxxxx*" < /var/tempfs/out.$$
        then

 $SENDMAIL admin@xxxxxxxxxx < /var/tempfs/out.$$

else

 $SENDMAIL spam@xxxxxxxxxx  < /var/tempfs/out.$$

fi

else
  $SENDMAIL "$@" < /var/tempfs/out.$$
fi

exit $?

======================================

thanks a lot

Kev

-
: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Newbie]     [Audio]     [Hams]     [Kernel Newbies]     [Util Linux NG]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Device Drivers]     [Samba]     [Video 4 Linux]     [Git]     [Fedora Users]

  Powered by Linux