view src/imap/cmd-logout.c @ 295:c6c0e376008f HEAD

close mailbox before sending "OK Logout completed", because the closing may take some time with mbox
author Timo Sirainen <tss@iki.fi>
date Mon, 23 Sep 2002 13:30:21 +0300
parents 3b1985cbc908
children fd8888f6f037
line wrap: on
line source

/* Copyright (C) 2002 Timo Sirainen */

#include "common.h"
#include "commands.h"

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;
}