procmail
[Top] [All Lists]

Re: conditional recipe execution

1998-01-08 18:09:38
Geoff Mulligan wrote,

| I would like to set up a recipe that says to execute this recipe GOOD if any 
| of the preceeding recipes matched otherwise execute recipe BAD
| 
| 
| :0
| * foo
| {
| 
|   :0 
|   * foo bar1
|   | something
| 
|   :0
|   * foo bar2
|   | something else
| 
|   :0 A
|   | GOOD
| 
|   :0 E
|   | BAD
| }
| 
| but I want GOOD run if either 'foo bar1' or 'foo bar2' is matched and BAD run 
| if neither matched.

The troubles are (1) the recipes that run "something" and "something else"
are delivering, so mail that matches "foo bar[12]" won't get down to "GOOD"
and (2) the "A" on the GOOD recipe refers back only to "something else" and
not to "something", so if the "something" recipe weren't delivering, mail
that matched "foo bar1" would still run BAD rather than GOOD.

Try this:

 :0
 * foo
 {
   LASTFOLDER

   :0c
   * foo bar1
   | something

   :0c
   * foo bar2
   | something else

   :0
   * LASTFOLDER ?? .
   | GOOD

   :0E
   | BAD
 }

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