Thu 98-02-05 Kay Hayen <Kay(_at_)kayhayen(_dot_)com> list.procmail
|
| :0: /my_absolute_path/lockfile
| just in order to know where it is?!
If that matters to outside world, yes, prefer using the explicit
lockfile name and you know where it is. I assume that we canb derive
the lockfilename name from the recipe, like
:0:
mbox
The lockfile would reside in
$MAILDIR/mbox.$LOCKEXT
Or then I haven't yet understood the creation of lockfiles :-)
All in all, I would'n care to guess or derive the name, I'd stick
explicit lockfilename there. Did you say you need to do this externally?
Here is how you would use lockfiles from shell:
[13.13 'killfiles' pm-tips.txt]
Recipe will drop the message (i.e. consider it 'delivered') if one
of its headers matches a pattern in killfile.
:0 hW: $HOME/.killfile.lock
| egrep -f -i $HOME/.killfile
The reason why there is explicit lockfile is that you must
be able to update the killfile while your procmail is
running. An example edit script is presented below.
#!/bin/sh
# program: killfile.sh
#
file=$HOME/.killfile
lock=$file.lock
lockfile $lock
emacs -q $file # or use whatever you prefer: vi, pico
rm -f $lock
| And do you gurus have setups to watch for not-removed lock
| files or how do you handle cases where lock files might
| just not vanish for for longer times.
David or Phil certainly will have trick or two in their bags.
I'd be suprised if you got into situation where lockfile doesn't
go away after sec or two, All the magic is supposed to be handled
by procmail itself.
jari