Thanks, Sergey. It looks like I could solve my problems by setting mandatory locking and then a very short time out. So if the client is actively using the server then it would stay alive and locked, but otherwise it would get unlocked. This would also solve the problem with orphan processes. (I didn't mean to say that mandatory locking was causing the orphan processes, but only that if the orphan processes hold locks, you would have a problem.)
However, the timeout doesn't seem to be working. I said program imap4d { mode inetd; mandatory-locking { enable yes; } timeout 60; ... } Then I connected to the IMAP server, logged in, and waited several minutes, but it did not disconnect me. Does it only work in daemon mode? Thanks for your help. Ken