MBOX-Line: From arnt at gulbrandsen.priv.no  Fri Jun 30 09:49:01 2006
To: imap-protocol@u.washington.edu
From: Arnt Gulbrandsen <arnt@gulbrandsen.priv.no>
Date: Fri Jun  8 12:34:37 2018
Subject: [Imap-protocol] IMAP disconnection
In-Reply-To: <etPan.44a548f0.6bad5e90.d87@utopia>
References: <etPan.44a548f0.6bad5e90.d87@utopia>
Message-ID: <kfeFnb6PW1GA+CfAeAs4lA.md5@libertango.oryx.com>

My suggestion:

Send LOGOUT at the same time on all your connections, wait for one 
second (you need not listen for responses), and quit.

The connection close packets will arrive at the server about 0.8-1.2 
seconds after the LOGOUT commands, so the servers have started 
processing LOGOUT by that time, and most servers will only discover 
that the connection was closed when they've finished doing the logout 
processing. (There are exceptions. At least one server discovers it 
sooner.)

This won't hurt the servers. You're behaving much like a random laptop, 
so any server which has a problem with your behaviour has a problem 
with normal laptop clients, too. (When a user closes the lid, the 
laptop has to sleep right there and then. Not 30 seconds later.)

Arnt

