procmail
[Top] [All Lists]

Re: Backing up mail

1999-11-22 09:04:52
When I suggested this code to Brock Rozen,

| >  :0
| >  * !^X-Backup: Disabled
| >  {
| >   :0Wc: # $BACKPFILE$LOCKEXT will do just fine as the local lockfile
| >   * < 500001
| >   $BACKPFILE
| >   :0EWhc:
| >   $BACKPFILE
| >
| >   :0
| >   { EXITCODE = 75  HOST }
| >  }

He asked,

| This last section worries me -- is seems like it will run every time a
| piece of mail comes through. If so, then one piece of mail should snowball
| -- as it will get sent back to sendmail each time, no?

Yes.  Sorry.  It was a case of half-rumped editing: originally the brace-
launching recipe orkfayed a clone, and the two saves to $BACKPFILE did not
have their own `c' flags, so the clone would have fallen to EXITCODE=75 HOST
only if the save to $BACKPFILE failed.  But the parent procmail would still
deliver the message according to later recipes, and we didn't want that, so
I got rid of the clone and put `c' flags onto the saves to $BACKPFILE.

Thanks for catching it, Brock.  Here's a fix:

     :0
     * !^X-Backup: Disabled
     {
      :0Wc: # $BACKPFILE$LOCKEXT will do just fine as the local lockfile
      * < 500001
      $BACKPFILE
      :0EWhc:
      $BACKPFILE
   
      :0
      * $ ! LASTFOLDER ?? (^^|/)$BACKPFILE^^
      { EXITCODE = 75  HOST }
     }

| I'm just wondering, shouldn't it be :0e ?

An `e' flag might do instead of the test on $LASTFOLDER, but I'm not sure
exactly how that would work with the preceding `E' flag.

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