summaryrefslogtreecommitdiffstats
path: root/src/imap/cmd-unselect.c
blob: 7f9f547d477a9e3f7cf00578e7e90584f2c59820 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* Copyright (c) 2002-2018 Dovecot authors, see the included COPYING file */

#include "imap-common.h"
#include "imap-commands.h"

bool cmd_unselect(struct client_command_context *cmd)
{
	struct client *client = cmd->client;

	if (!client_verify_open_mailbox(cmd))
		return TRUE;

	i_assert(client->mailbox_change_lock == NULL);

	imap_client_close_mailbox(client);
	client_send_tagline(cmd, "OK Unselect completed.");
	return TRUE;
}