Glen Edwards asked,
| Here's my recipe. It pipes email to a listserve program I wrote. I need a
| lock file that doesn't release until the program forks and the parent
| dies. Hence the :0 w:
|
| :0 w:
| * ^TO_.*peace_talk|.*naztalk|.*healing
| | /usr/local/bin/listserve.cgi
|
| Are you saying that the following would do the trick?
|
| :0 w: listserve.cgi.lock
| * ^TO_.*peace_talk|.*naztalk|.*healing
| | /usr/local/bin/listserve.cgi
Almost. The colon line and the action are correct now, and you won't get the
error any more about inability to determine a name for the lockfile. But the
condition is wrong; we'll get back to that.
| If so, does it release automatically and delete itself or do I need to
| write an unlink command somewhere in my listserve.cgi script?
Procmail unlinks the lockfile on its own.
However, I'm sure your condition is not what you want, that you really mean
* ^TO_(peace_talk|naztalk|healing)
For one thing, ^TO and ^TO_ expand to expressions that already include a
better ending than ".*", so by adding ".*" you make them weaker. Second,
what you originally wrote looks through the head for any appearance of
^TO_.*peace_talk
or any appearance of
.*naztalk # which is the same as an appearance of naztalk,
# only slower to search for
ANYWHERE in the head, not only on lines that start with matches to ^TO_,
or any appearance of
.*healing # same comment as above about the .*
AGAIN, anywhere in the head.
Even if you really do mean to look for naztalk or healing anywhere in the
head but peace_talk only in a field matching ^TO_, those ".*"s would impair
performance.