I have (somewhat reluctantly) decided to accept your suggestion to add a PFLUSH to the mm_log() and mm_notify() event handlers. Although doing these PFLUSHes is a bit anti-social, it should not be significant in most cases.
However, this is at best a shim for the underlying problems: 1) For some reason, your system is not giving a HUP interrupt to those IMAP sessions. The CLOSE_WAIT indicate that your system knows that the client has disconnected, but for some reason the IMAP server was never told. 2) Your client should have not a 1 minute timeout waiting for SELECT. IMAP is not HTTP. Timing out and trying again isn't a helpful procedure in a stream-oriented stateful protocol. The only "timeout" for IMAP should be the user deciding "the system is too loaded, I'll give up and try again later when it isn't so loaded." -- Mark -- http://staff.washington.edu/mrc Science does not emerge from voting, party politics, or public debate. Si vis pacem, para bellum.
