procmail
[Top] [All Lists]

Re: priorities of ( )

1998-04-29 11:05:08
On Wed, 29 Apr 98 11:28:57 -0400, Timothy J Luoma
<luomat+Lists/procmail(_at_)luomat(_dot_)peak(_dot_)org> wrote:
Will
 * ^(ABC|XYZ)
always prefer ABC and only use XYZ if ABC doesn't exist, or will it use XYZ  
if it comes first (higher in the headers)?

As usual, that is extremely simple to test for yourself:

 $ cat scratch/moo.rc
 SHELL=/bin/sh MAILDIR=$HOME/scratch DEFAULT=moo.out VERBOSE=yes
 :0:
 * ^\/(ABC|XYZ)
 moo.out
 # Granted, the \/ affects how some things work. It gives us logging, tho

 $ procmail scratch/moo.rc <<HERE
XYZ exists
ABC exists, too
# Let's hope this never ends up in somebody's real mailbox :-)
HERE
 procmail: [31760] Wed Apr 29 20:45:50 1998
 procmail: Assigning "MATCH="
*procmail: Matched "XYZ"
 procmail: Match on "^\/(ABC|XYZ)"
 procmail: Locking "moo.out.lock"
 procmail: Assigning "LASTFOLDER=moo.out"
 procmail: Opening "moo.out"
 procmail: Acquiring kernel-lock
 procmail: Unlocking "moo.out.lock"
   Folder: moo.out                                                           89

So yes, your doubts were well-founded. You need to put those in two
separate recipes and spell out the exact conditions for the case where
XYZ comes before ABC.

/* era */

-- 
 Paparazzi of the Net: No matter what you do to protect your privacy,
  they'll hunt you down and spam you. <http://www.iki.fi/~era/spam/>

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