On Wed, 9 Oct 2002, Arnt Gulbrandsen wrote:
>Hi,
>if I (as an IMAP client) have to exit quickly and have an open IMAP
>connection, I can't wait around for the IMAP server's responses.
>In this case, should I send LOGOUT and immediately close the TCP
>connection, or should I just close the TCP connection?  I can't quite make
>up my mind.

Send LOGOUT, then close the connection. The IMAP service is happy, because
it can perform whatever it needs to of checkpoints etc. You're happy,
because sending LOGOUT doesn't slow down your app and you can safely exit.

The IMAP service might get an error when writing the response code to the
client, but this last error should be uninteresting for both the service
and your client.  After all - the LOGOUT command can never give anything
else than OK from what I understand.

RFC2060 isn't quite clear here, though, because it lists OK and BAD as
valid responses,

   Result:     OK - logout completed
               BAD - command unknown or arguments invalid

      The LOGOUT command informs the server that the client is done with
      the connection.  The server MUST send a BYE untagged response
      before the (tagged) OK response, and then close the network
      connection.

But it doesn't, from what I can tell, explain the logics behind the BAD
reponse here.

QUIT and then close() is very common in MTAs when delivering mail.

Andy

>--Arnt
>--
>-----------------------------------------------------------------
> For information about this mailing list, and its archives, see:
> http://www.washington.edu/imap/imap-list.html
>-----------------------------------------------------------------
>
>

-- 
Andreas Aardal Hanssen


Reply via email to