# HG changeset patch # User Timo Sirainen # Date 1032777021 -10800 # Node ID c6c0e376008f8dc865a382013cf3da255aa94046 # Parent e6a00377af97ed7935f19babc5008bca708d791d close mailbox before sending "OK Logout completed", because the closing may take some time with mbox diff -r e6a00377af97 -r c6c0e376008f src/imap/cmd-logout.c --- a/src/imap/cmd-logout.c Mon Sep 23 13:22:37 2002 +0300 +++ b/src/imap/cmd-logout.c Mon Sep 23 13:30:21 2002 +0300 @@ -6,6 +6,15 @@ int cmd_logout(Client *client) { client_send_line(client, "* BYE Logging out"); + + if (client->mailbox != NULL) { + /* this could be done at client_disconnect() as well, + but eg. mbox rewrite takes a while so the waiting is + better to happen before "OK" message. */ + client->mailbox->close(client->mailbox); + client->mailbox = NULL; + } + client_send_tagline(client, "OK Logout completed."); client_disconnect(client); return TRUE;