view src/imap/cmd-uid.c @ 9445:d7f8dbc38fd7 HEAD

imap: If client disconnects while appending, don't treat the rest of the message as commands.
author Timo Sirainen <tss@iki.fi>
date Tue, 20 Oct 2009 13:21:13 -0400
parents f1a6c9dd4c33
children 00cd9aacd03c
line wrap: on
line source

/* Copyright (c) 2002-2009 Dovecot authors, see the included COPYING file */

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

bool cmd_uid(struct client_command_context *cmd)
{
	struct command *command;
	const char *cmd_name;

	/* UID <command> <args> */
	cmd_name = imap_parser_read_word(cmd->parser);
	if (cmd_name == NULL)
		return FALSE;

	command = command_find(t_strconcat("UID ", cmd_name, NULL));
	if (command == NULL) {
		client_send_tagline(cmd, t_strconcat(
			"BAD Unknown UID command ", cmd_name, NULL));
		return TRUE;
	}

	cmd->name = p_strconcat(cmd->pool, "UID ", cmd_name, NULL);
	cmd->cmd_flags = command->flags;
	cmd->func = command->func;
	cmd->uid = TRUE;
	return cmd->func(cmd);
}