procmail
[Top] [All Lists]

Re: lockfile problem

1999-05-18 03:42:36
Daniel Kabs wrote:

SUBJECT=`formail -xSubject:` 
:0 w 
* ^To:(_dot_)*root(_at_)physik(_dot_)uni-kl(_dot_)de
{
  :0 fw
  |formail -I "Subject: [root]$SUBJECT"

  :0 
  /var/spool/mail/kabs
}

I added the "w" flag so procmail doesn't continue concurrently 
and I can more easily understand what it's doing :-)

Ummm ... what exactly do you mean with "continue concurrently"?
I doubt that the first "w" is really what you want there.


I checked the status of /var/spool/mail/kabs.lock while the 
mail was processed and it was never created.

Well, you haven't told procmail to use a lock. Add a second colon
after the 0 for the delivering recipe, and you get it:
        :0:
        /var/spool/mail/kabs

Two more tips:

- You can make the formail recipe more efficient by changing "fw"
to "fhw"; this feeds only the header to formail instead of the
entire message.

- If you don't really want to match only messages that have been
sent "To:" root, but also ones that have reached root via "Cc:"
etc., use the ^TO_ macro (or ^TO if your procmail doesn't have
it yet):
        * ^TO_root(_at_)physik(_dot_)uni-kl(_dot_)de

To sum up:
        :0
        * ^TO_root(_at_)physik(_dot_)uni-kl(_dot_)de
        {
                :0 fhw
                | formail -I "Subject: [root]$SUBJECT"

                :0:
                /var/spool/mail/kabs
        }

/HW

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