procmail
[Top] [All Lists]

Problems with file locking

2004-10-05 08:34:48
Greetings,

I am still trying to get procmail to work as a local delivery agent delivering into AFS mailboxes. The status so far:

Martin supplied me with a snippet of code for authenticate.c that allowed us to put mail into a mailbox that was within a directory named for the user. That is, instead of the default mailfile being /var/spool/mail/$LOGNAME, we are using /afs/@cell/common/spool/mail/MailDirs/$LOGNAME/$LOGNAME. 'procmail -v' confirms that this is now set correctly.

When we started testing this, we found that mail was delivered to the mailbox but volume of mail started to increase, we ran into locking issues that manifested themselves by repeated renaming of lock files to BOGUS.* files. No mail was lost however.

We figured out that the locking mechanisms which were chosen by autoconf (fcntl and lockf), will return successful even though they do not really work in AFS. According to other documentation, we discovered that flock should work in AFS. So....


We spent some time recompiling with flock hardwired in the Makefile. This did not solve the problem.

We then compiled with only dotlocking enabled. Still getting BOGUS lockfile renames.

Thinking that there may be some sort of race condition going on, we then set LOCKFILE=/tmp/.procmail.lock in /etc/procmailrc. Our thinking was that this would serialize message delivery and eliminate the BOGUS lockfiles in the mail directory. It didn't.

So, first question:

- Do I misunderstand how LOCKFILE works?

Next, after spending some time looking through the files in the build directory, I was reminded that, in autoconf, I had set MAILSPOOLDIR to "/afs/@cell/common/spool/mail/MailDirs". In reality, it should have $LOGNAME appended to it but I could not think of a way to get this passed in correctly to the compilation (hence the modification to the source in authenticate.c).

So, the next question is:

- Is there a chance that one part of the code is trying to write a lock file in the correct user spool dir and looking to remove it from the spool dir defined by autoconf thereby leaving a seemingly bogus lockfile behind?

Finally, if there is someone out there who is successfully using sendmail/procmail/AFS for mail delivery, I would love to hear how have things configured.

Thanks.

-David-
--
David R. Steiner                               
david(_dot_)r(_dot_)steiner(_at_)dartmouth(_dot_)edu
UNIX System Manager                            Phone:  603.646.3127
Dartmouth College                              Fax:     603.646.1041

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>
  • Problems with file locking, David R. Steiner <=