[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [~OT] procmail recipe local lockfiles



Nori Heikkinen <nori@sccs.swarthmore.edu> writes:
> anyone have any opinions / dogma to share on the use or omission of
> the second colon?

Below is a snip from the procmail mini-faq



8<------8<------8<------8<------8<------8<------8<------8<------8<------
Under Unix and other multitasking operating systems, several processes
can be running at once. This means several mail messages can be in
delivery at the same time. Without Procmail, the default system mailer
hopefully handles this just fine when mail is delivered to a system
mailbox, but if two Procmails are delivering two messages to the same
file more or less at the same time, you end up with problems. (A typical
symptom is that the first message gets a FFrom in its first line, and the
second gets a rom without the F. This messes up the mailbox format
thoroughly.)

Rule of thumb: Use file locking when delivering to a file. Don't use file
locking when delivering to /dev/null (because then it doesn't matter if
the message gets mangled, and you might not have the permission to
acquire a lock on a device), forwarding to another address, or piping
into a program. A pipeline which ends up appending to a file should still
use a lock, of course, since there is the same race condition as when
delivering straight to a file.

Rule of index finger: Using an unnecessary extra lock seldom hurts. (When
it does hurt, you'll notice. :^)

8<------8<------8<------8<------8<------8<------8<------8<------8<------

Glyn
-- 
Debian Home       http://www.debian.org
Debian Planet     http://www.debianplanet.org/ 
For the children  http://www.debian.org/devel/debian-jr/
In a hurry???     http://qref.sourceforge.net/ 



Reply to: