procmail
[Top] [All Lists]

Re: Suppressing Unwanted Error Message

1997-07-19 10:47:00
Paul Bartlett continued,

|     Well, if nothing else, I am learning a lot more about procmail, and I
| suppose that is a Certified Good Thing. :)

If not certified, at least certifiable.

I had suggested,

| > You can write it like this, and procmail will not comment on a bad exit
| > code from egrep (unless you have VERBOSE on, in which case procmail will
| > log "No match" for the egrep condition if it exits with failure):
| > 
| >        :0
| >        * ? egrep -is "$WHOFROM" $USERLIST
| >        { first big nesting block }
| >        :0E
| >        { second big nesting block }

Paul replied,

|     I discovered the hard way (plowing through a long log) that 
| I failed to have even a "dummy" action routine on:
| 
| # check whether $WHOFROM value is in # $USERLIST file
| :0 wc
| | egrep -is $WHOFROM $USERLIST

No, that is correct.  The line beginning with the pipe *is* the action.

| This caused unwanted behavior.  So I made it:
| 
| # check whether $WHOFROM value is in # $USERLIST file
| :0 wc
| | egrep -is $WHOFROM $USERLIST
| { }

No, that is wrong.  You are trying to get two actions out of one recipe.
Procmail will probably say that it is skipping the left brace and then
the right brace might even make it pop up one nesting level.

| P.S.  I understand the structuring of the code as David has given it in
| his response, but to me the logic is clearer if I keep each big nesting
| block in its own subrecipe (should have indented, as I said).

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