procmail
[Top] [All Lists]

Re: Locks OK with {}'s?

1997-12-23 13:18:08
Bryan Farrish asked,

| Is it OK to use a lock either inside or outside of a nest, or will this 
| cause problems?   Ex...
| 
| :0H:
| * ^To:.*me
| * ^Subject:.*subscribe
| { 
|   :0B
|   * subscribe
|   NEW-SUBS
| }

In that particular example, you should have the local lockfile on the inner
recipe:  
  
  :0 # H is implicit anyway (needed only to distinguish HB from B)
  * ^To:.*me
  * ^Subject:.*subscribe
  { 
    :0B:
    * subscribe
    NEW-SUBS
  }

A local lockfile on a recipe whose action line is to open a braced block
doesn't make sense unless you are launching a clone, and it will generate
an "extraneous locallockfile [sic] ignored" error.  Meanwhile, you'd be
without a lock on the recipe that actually writes to a folder.

It should be noted that the whole thing could be done in one recipe in
versions of procmail recent enough to have the "var ??" syntax:
  
  :0: # H is implicit
  * ^To:.*me
  * ^Subject:.*subscribe
  * B ?? subscribe
  NEW-SUBS

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