imap-commands.h revision b98f1ffc049e8c4c1677173ea65830aa07b3ef87
#ifndef IMAP_COMMANDS_H
#define IMAP_COMMANDS_H
struct client_command_context;
#include "mail-storage.h"
#include "mail-namespace.h"
#include "imap-parser.h"
#include "imap-sync.h"
#include "imap-commands-util.h"
enum command_flags {
/* Command uses sequences as its input parameters */
COMMAND_FLAG_USES_SEQS = 0x01,
/* Command may reply with EXPUNGE, causing sequences to break */
COMMAND_FLAG_BREAKS_SEQS = 0x02,
/* Command changes the mailbox */
/* Command uses selected mailbox */
/* Command requires mailbox syncing before it can do its job. */
COMMAND_FLAG_REQUIRES_SYNC = 0x08,
/* Command allows replying with [NONEXISTENT] imap resp code.
Dovecot internally returns it for all kinds of commands,
but unfortunately RFC 5530 specifies it only for "delete something"
operations. */
COMMAND_FLAG_USE_NONEXISTENT = 0x10
};
struct command {
const char *name;
enum command_flags flags;
};
/* Register command. Given name parameter must be permanently stored until
command is unregistered. */
enum command_flags flags);
void command_unregister(const char *name);
/* Register array of commands. */
/* Register hook callbacks that are called before and after all commands */
/* Execute command and hooks */
/* Finish counting command statistics. This is called automatically when
command_exec() returns, but it should be called explicitly if the stats are
needed during command_exec(). */
void commands_init(void);
void commands_deinit(void);
/* IMAP4rev1 commands: */
/* Non-Authenticated State */
/* Authenticated State */
/* Selected state */
/* IMAP extensions: */
/* IMAP URLAUTH (RFC4467): */
/* private: */
#endif