procmail
[Top] [All Lists]

Re: Filtering on critera not based on message?

2001-09-22 08:14:19
On Fri, Sep 21, 2001 at 04:20:54PM -0700, Professional Software Engineering 
wrote:
At 15:31 2001-09-21 -0700, Kelsey Cummings wrote:

Try searching the archives for a thread titled "Checking the exitcode of a 
program" (try a specific search for "exitstatus", rather than exitcode, 
since the latter is a special procmail variable).

I'll look again, what I came up with before didn't directly
answer my question.

Basically, I've got a program that returns different
exit codes and based on those exit codes I'd like a
different set of procmail rules to be processed.

Uh, okay.  What's the problem?

I'm currently appling a global procmailrc on all of my
inbound mail for spam & virus.  Many of my users have
expressed the desire to be taken off of one or more of
these filters.

I've got two choices, write tools that manage .procmailrc
in the users home directory or enable the globalrc to have
the same capabilities.

So, the idea was, run the program which gets the users'
filter configuration and then execute the proper set
of procmail rules.

I see that you can feed the message to a pipe and
then take different actions based on the exit code
there but since the exit code isn't related to the
message...

So?  Use the 'i' flag so procmail doesn't take the failure of all the data 
to be read as an indication of 'delivery failure', and just assign the 
results to your variable, then take action on the variable...

It just seemed wasteful to attempt to feed the message into
the pipe.  I thought there might be some other way to build
conditions based on return values of external programs or
set environment variables.

in psuedo code:

: [if $NOFILTER]
$MAIL
else
some procmail rules...

Thanks!

-- 
Kelsey Cummings - kgc(_at_)sonic(_dot_)net         sonic.net
System Administrator                    300 B Street, Ste 101
707.522.1000 (Voice)                    Santa Rosa, CA 95404
707.547.2199 (Fax)                      http://www.sonic.net/
Fingerprint = 7F 59 43 1B 44 8A 0D 57  91 08 73 73 7A 48 90 C5
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>