[tpop3d-discuss] The way locking in /var/mail works...

Chris Elsworth chris at shagged.org
Thu, 29 May 2003 07:45:34 +0100


On Thu, May 29, 2003 at 07:27:36AM +0200, Martin Schmitt wrote:
> 
> I have tried to manually authenticate against TPOP3D and saw that TPOP3D
> locks the mailbox immediately after USER/PASS were submitted successfully.
> I don't know enough about the implementation of POP3 servers to judge if
> that's the right time for locking or not.

It's the easiest time; keeping the mbox locked for the duration of the
sessions makes life a lot easier. It should be technically possible to
only lock the mbox when an operation is being performed on it, but you
then have to rescan it before every operation - something else might
have changed it. This would be performance suicide for large
installations, retrieving 2000 messages in a single session would
result in 2000 locks being created and subsequently destroyed.

> Now, my question is: Who is behaving in a "wrong" kind of way here? Does
> TPOP3D lock the mailbox too early, or does one of tmda-cgi and tmda-ofmipd
> not terminate their POP3-session properly?

It shouldn't matter if tmda isn't terminating properly, once the
session is closed tpop3d ought to clear the lock. If I telnet to
tpop3d, login, then kill -9 the telnet, the lock is cleared, so tpop3d
is working (under normal circumstances - you may have found a bug
where it sometimes doesn't clear the lock).

-- 
Chris