On Tue, Oct 05, 1999 at 01:40:07PM -0600, [EMAIL PROTECTED] wrote:
> Has anyone implemented such a thing already? If not, any ideas
> on how it might be done? As I understand it, locking the maildir
> in qmail-pop3d is probably the best solution to this, as it gets
> called immediately after authentication has occurred. My main concern
> is avoiding the possibility (as much as possible) of a single process
> being killed before completion and causing the lock file (or whatever) to
> remain in effect even after the program has completed, making it impossible
> for a user to check their mail until the file is manually removed. Perhaps
> an flock on a standard file would work, but as I understand it, flock will
> hang around and wait if it's not able to get a lock immediately, which
> is counterproductive to the dropping the connection immediately if
> another instance is in progress. I could be wrong on this.
Consider using the "setlock" program from the serialmail package. It was
designed to lock a file called "seriallock" in a Maildir, while one
instance of maildirsmtp runs. I have used it very successfully in many
of my other programs. You could invoke it like this:
tcpserver 0 110 /var/qmail/bin/qmail-popup my.host.name \
/usr/local/bin/checkpassword /usr/local/bin/setlock Maildir/poplock \
/var/qmail/bin/qmail-pop3d Maildir &
--
See complete headers for more info