Subject: Client says LOGOUT and gets lost

From: "Russ Atkind" <[email-masked]>
Date: Sat, 21 Mar 1998 01:29:07 -0500

What's the IMAP morality level of a client sending a LOGOUT command and then
immediately closing the socket without waiting for a response?

---

From: Mark Crispin <[email-masked]>
Date: Fri, 20 Mar 1998 23:38:38 -0800 (PST)

> immediately closing the socket without waiting for a response?

It's obnoxious behavior.  Depending upon the underlying operating system
implementation, it could cause the server to be killed without cleaning up
after itself (good ones won't do this, but all the world isn't good).  It
could cause spurious system error logs at the server end, as the IMAP server
conscientiously records what (to it) seems to be a network connection failure.

But it's not the end of the world either.  The worst thing is that it may lead
the user to wonder "what other corners did this client cut?"

---

From: Lyndon Nerenberg <[email-masked]>
Date: Mon, 23 Mar 1998 10:17:24 -0700 (MST)

> immediately closing the socket without waiting for a response?

Client writers who do this should be shot. What on earth do they think 
they are optimizing?

1) Depending on the client TCP stack and depending on how you shut down 
the connection, the client may not even do the TCP disconnect sequence. 
Thus, you leave a server hanging around until the idle timer kicks (at 
least 30 minutes).

2) Again, depending on your client TCP stack, and depending on how you 
shut down the connection, you can leave the server in a TCP time wait 
while it tries to push the BYE message to the client. This consumes 
unnecessary server resources. And, on a busy server, when the sysadmins 
see several hundred imap4 sockets in TIME_WAIT state, the blame is 
*always* placed on the server. (Do you wonder why this annoys me?)

The bottom line is, if you can go to the effort to code up an IMAP4 
client, you can bloody well go to the effort the read the BYE response 
from LOGOUT.

--lyndon