procmail
[Top] [All Lists]

Re: Procmail & elm lock interaction

1996-07-23 22:43:18
Jeff Wasilko wrote,

| Procmail is using dotlocking, flock() locking, and elm is configured
| for USE_DOTLOCK_LOCKING (.lock) USE_FLOCK_LOCKING USE_FCNTL_LOCKING.

| When procmail is sorting mail into a non-system mailbox while Elm
| has the mailbox open, elm will quit with this error:
|       
|       Folder is corrupt!!  I can't read it!!

Elm does no locking whatever on any folder except the one named in $MAIL
(and not always on that one), so procmail can add new mail to any other
folder with impunity even while Elm is displaying it.

| I suspect that the problem is that elm is looking for lock files
| in /usr/spool/locks (for non-system mailboxes), while procmail is
| locking in same directory as the mailbox file).

The problem is that Elm is not locking the folder at all.  Procmail freely
adds new mail to that folder, and since procmail files mail by writing the
"F" of "From", waiting one second, and then continuing with "rom " and the
rest of the From_ line, during that second Elm finds that the folder is
corrupt: it suddenly is one byte longer than Elm expects and doesn't end
in two newlines (or even one).

| How do I get procmail and elm to play nicely together?

Punish both until one confesses?  Truly, I do not know.  Elm 2.5 is supposed
to have a user-selectable option to lock *all* folders (and one to display N
flags for new mail in any folder), but until then I have no advice.

Wrapping Elm in a script that calls lockfile beforehand and rm -f afterward
has its own drawbacks: it keeps the wrong folder locked if you change folders
within Elm, and it still has potential conflicts with procmail if you tell
Elm to save or copy mail from one folder to another.

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