[tpop3d-discuss] Maildir locking, to prevent more than 1 simultaneous access?

Jakob Hirsch jh at plonk.de
Fri, 24 Jan 2003 15:46:56 +0100


Chris Lightfoot wrote:

> to create a directory called $(maildir)/.poplock and
> remove it on exit. I think that there should probably be

You could create a zero-byte file in this directory named $PID, so the
next process authenticating this user can look if the process that
created this directory is still alive. This obviously only works if
tpop3d only runs on a single machine. Or do you know a simple method the
get information about other machines' running processes?

> a timeout if the directory is more than (say) 30 minutes
> old.

30 minutes may be a little short if somebody has a slow line and pops
his mail seldomly. On the other hand these people usually don't start
multiple pop3-clients...