doveadm-mail.c revision 71f4549303dc1691382748a096c2ada9d2a1a9fe
48f78a48f2e1cf299026544444666471ae16ad97Timo Sirainen/* Copyright (c) 2009-2016 Dovecot authors, see the included COPYING file */
48f78a48f2e1cf299026544444666471ae16ad97Timo Sirainen#define DOVEADM_MAIL_CMD_INPUT_TIMEOUT_MSECS (5*60*1000)
48f78a48f2e1cf299026544444666471ae16ad97Timo SirainenARRAY_TYPE(doveadm_mail_cmd) doveadm_mail_cmds;
doveadm_mail_cmd_module_register = { 0 };
static int killed_signo = 0;
bool doveadm_is_killed(void)
return killed_signo != 0;
int doveadm_killed_signo(void)
return killed_signo;
int exit_code = 0;
switch (error) {
case MAIL_ERROR_NONE:
i_unreached();
case MAIL_ERROR_TEMP:
case MAIL_ERROR_NOTPOSSIBLE:
case MAIL_ERROR_EXISTS:
case MAIL_ERROR_CONVERSION:
case MAIL_ERROR_INVALIDDATA:
case MAIL_ERROR_PARAMS:
case MAIL_ERROR_PERM:
case MAIL_ERROR_NOQUOTA:
case MAIL_ERROR_NOTFOUND:
case MAIL_ERROR_EXPUNGED:
case MAIL_ERROR_INUSE:
struct doveadm_mail_cmd_context *
return ctx;
int ret = 0;
return ret;
return ctx;
struct mailbox *
struct mail_search_args *
return sargs;
int ret = 0;
return ret;
int ret = 0;
} T_END;
return ret;
const char *const args[])
return ctx;
const char **error_r)
int ret;
if (ret != 0)
return ret;
if (ret <= 0) {
if (ret < 0) {
error);
return ret;
if (ret < 0) {
return ret;
const char **error_r)
const char *wildcard_user)
unsigned int user_idx;
int ret;
user_idx = 0;
T_BEGIN {
if (ret < 0)
else if (ret == 0)
} T_END;
if (doveadm_verbose) {
if (killed_signo != 0) {
if (doveadm_verbose)
if (ret < 0) {
const char **username_r)
struct doveadm_mail_cmd_context *
return ctx;
static struct doveadm_mail_cmd_context *
if (doveadm_debug)
return ctx;
const char *wildcard_user)
int ret;
const char *error;
if (ret < 0) {
} else if (ret == 0) {
const char *const **argv)
unsigned int len;
return FALSE;
return FALSE;
return FALSE;
return TRUE;
const struct doveadm_mail_cmd *
const char *const **argv)
unsigned int cmd_name_len;
const char *const *orig_argv;
int orig_argc;
return cmd;
return cmd;
return NULL;
return FALSE;
return TRUE;
return cmd;
return NULL;
return TRUE;
return FALSE;
&cmd_copy,
&cmd_move,
void doveadm_mail_init(void)
&mod_set);
void doveadm_mail_deinit(void)
const char *wildcard_user;
const char *fieldstr;
for(i=0;i<argc;i++) {