Subject: Re: Part-time global lockfiles

From: [email-masked] (David W. Tamkin)
Date: Sat, 4 Mar 1995 13:54:19 -0600 (CST)

Jeremy Hankins asked,

| Anyway, if my mailer doesn't use lockfiles how do I set things up so
| that I don't [lose] any more messages?  I've considered using an alias
| or script to run my mailer that would create a lockfile and remove it
| when I'm done reading my mail.

Look at examples/2rmail and examples/3rmail in the procmail distribution.
They pretty much do exactly that.

| There are (at least) two problems with that -- a) procmail will often be
| locked out of my mailfiles for long periods of time,

If your mail reading threatens to go for longer than seventeen minutes, shell
out of your mailer and touch the lockfiles or exit your mailer (and the
script) and restart the script.

| and b) if I use a global lockfile (and I have no idea how I'd implement it
| w/ lockfiles for each individual mail file) can I make procmail respect a
| global lockfile without having it create one itself?

It already will.  If a lockfile exists (and isn't stale), procmail can't tell
whether it was created by another instantiation of procmail, by the lockfile
binary, by royal proclamation, by court order, or by a curse on your computer.

The only problem can come if, while you're in your mailer, you change to
a folder you hadn't expected to read and which you hadn't locked.  If you
then change or clear out that folder and at the same instant procmail is
delivering to that folder, you run a risk.

David W. Tamkin  Box 3284  Skokie, Illinois  60076-6284
[email-masked]    MCI Mail: 426-1818   +1 312 714 5610