[comp.mail.misc] Version of `filter' that allows AND, OR etc. in conditions?

chip@tct.com (Chip Salzenberg) (05/24/91)

According to malc@equinox.unr.edu (Malcolm Carlock):
>Has anyone ever taken a crack at modifying the filter program to allow
>&&, || etc. in the conditionals?

Deliver exists for just such situations.  It allows practically
unlimited flexibility in deciding how to handle any given mail
message.

Such flexibility is not free, of course. It requires a bit of shell
programming to use.  But that shell programming need not be complex.
Here's an example of how to toss all mail which is from dull-user AND
about dull-subject:

    case "$SENDER" in
    *!dull-site!dull-user | dull-user@dull-site )
	if header -f subject $HEADER | grep -i "dull-subject" >/dev/null
	then
	    # Bit-bucket dull mail.
	    echo DROP
	    # As an alternative, uncomment the following line to
	    # put dull mail in its own mailbox:
	    #echo "$1:mbox.dull"
	    exit
	fi ;;
    esac
    echo "$1"

On the off chance that the Bourne shell isn't your cup of tea, you can
write your scripts in Perl, ksh, csh (ugh), or whatever other program
tickles your fancy.  (Deliver understands "#!".)

Deliver 2.1 is currently completing beta test.  Coming soon to a
sources group near YOU!

(Doesn't that sound like a threat? :-))
-- 
Brand X Industries Custodial, Refurbishing and Containment Service:
         When You Never, Ever Want To See It Again [tm]
     Chip Salzenberg   <chip@tct.com>, <uunet!pdn!tct!chip>