procmail
[Top] [All Lists]

Re: MH - 2 folders at once?

1996-11-01 15:26:25
Alan Stebbens suggested the following to Malcolm Jackson:

| With MH, you must file a message into a folder, and then refile it to
| the other folders.   Here's an example:
| 
|     PATH=$PATH:/usr/local/lib/mh
| 
|     :0:$M/ixin.lock
|     * ^Sender:.*owner-ixion
|     | rcvstore +ixin ; refile last -link -src +ixin +dtp
| 
| This method is not bullet-proof however.  There is a small window of
| time during which the state of the +ixin folder could change causing the
| meaning of "last" to not be the most recently arrived message.  It is a
| small window of time, but computers are amazingly fast and quick to make
| the most of even a small opportunity :^).

Now, I know nothing about MH, so this is an honest (if naive) question:

Would a `w' or `W' flag (so that procmail would hold onto the local lockfile
until the shell that runs rcvstore and refile exits) take care of the race
condition risk?  Or what about this so that both MH directories get locks?

  :0
  * ^Sender:.*owner-ixion
  {
   LOCKFILE=$M/dtp.lock

    :0W:$M/ixin.lock
    | rcvstore +ixin ; refile last -link -src +ixin +dtp

   LOCKFILE # in case of drop-through on failure
  }

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