procmail
[Top] [All Lists]

Re: Logging $MATCH

1997-05-17 16:00:00
Jack Lyons asked,

| If I have a recipe such as this: 
| 
| :0:
| * ^From.*(moe|larry|curly|shemp)@stooge\.net
| mail/stooges
| 
| I would like to know what matched when this recipe succeeds, and log it. 

| How would you rewrite the above recipe condition using the "\/" mechanism,
| to that I could have the block
| 
| {
|  LOG="$MATCH
| "
|  :0
|  mail/stooges
| } 

You're almost there, Jack:

 :0
  * ^From.*\/(moe|larry|curly|shemp)@stooge\.net
  {
   LOG="$MATCH
"

   :0:
   mail/stooges
  }

or, if you prefer,

  :0
  * ^From.*\/(moe|larry|curly|shemp)@stooge\.net
  { LOG="$MATCH
" }
   :0A:
   mail/stooges

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