procmail
[Top] [All Lists]

Re: Suppressing Unwanted Error Message

1997-07-19 08:20:00
On Fri, 18 Jul 1997, Philip Guenther wrote:

Paul O Bartlett <pobart(_at_)access(_dot_)digex(_dot_)net> writes:
[omitted]

Since you want to use it as a condition, you could make it one:

      :0
      * ? egrep -is $WHOFROM $USERLIST
      * whatever conditions were on the following recipe(s)
      ...etc

Yes, program conditions have the email message on their stdin, and as
long as you don't have VERBOSE turned on, procmail won't log their
failure, it being expected.

    During normal operation, VERBOSE will be 'off' while this recipe is
being executed (if the logic executes it at all), and was deliberately
off during the test in which the superfluous (to me) "error" condition
was logged.

Note that if you use the 'e' flag on the following recipe (as opposed to
the 'a' flag) to determine whether the egrep succeeded or failed, then
you'll need to negate the program condition by putting a '!' in from of
the '?'.

    Mea culpa for not having included a little more of the recipe to
make things clearer.  Here is more of the skeleton.  I confess that I
am not quite clear what your first paragraph, "Yes, program conditions
..." refers to.  (I have never had reason to use '?' in a condition
line before, I not being a Un*x or procmail heavy.)  Do I interpret you
correctly that if I just add the '?' to the (only) condition as you
have it above, then procmail will not log it if egrep does not find a
match in the $USERLIST file, which is an anticipated condition
according to the recipe below?

    # check whether $WHOFROM value is in # $USERLIST file
    :0 wc
    | egrep -is $WHOFROM $USERLIST

    # subrecipe to execute if egrep _does_ find a match
    :0 a
    { big nesting block }

    # subrecipe to execute if egrep _does_not_ find a match
    :0 E
    { another big nesting block }

    I am getting close to having this recipe up and running, 
so I appreciate all the help I have been getting from people.

Thanks very much.
Paul                             <pobart(_at_)access(_dot_)digex(_dot_)net>
----------------------------------------------------------
Paul O. Bartlett, P.O. Box 857, Vienna, VA 22183-0857, USA
Finger, keyserver, or WWW for PGP 2.6.2 public key
Home Page:  http://www.access.digex.net/~pobart


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