doveadm-mail-flags.c revision af2cc755b98e6e61e3167b0d5e69b7c88d8e6aa5
/* Copyright (c) 2013-2016 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "imap-util.h"
#include "mail-storage.h"
#include "doveadm-mailbox-list-iter.h"
#include "doveadm-mail-iter.h"
#include "doveadm-mail.h"
#include <stdio.h>
struct flags_cmd_context {
struct doveadm_mail_cmd_context ctx;
enum modify_type modify_type;
enum mail_flags flags;
const char *const *keywords;
};
static int
const struct mailbox_info *info)
{
struct doveadm_mail_iter *iter;
return -1;
i_error("Invalid keywords: %s",
(void)doveadm_mail_iter_deinit(&iter);
return -1;
}
}
}
return doveadm_mail_iter_deinit_sync(&iter);
}
static int
{
const enum mailbox_list_iter_flags iter_flags =
struct doveadm_mailbox_list_iter *iter;
const struct mailbox_info *info;
int ret = 0;
ret = -1;
} T_END;
if (doveadm_mailbox_list_iter_deinit(&iter) < 0)
ret = -1;
return ret;
}
const char *const args[])
{
const char *const *tmp;
enum mail_flags flag;
switch (ctx->modify_type) {
case MODIFY_ADD:
doveadm_mail_help_name("flags add");
case MODIFY_REMOVE:
doveadm_mail_help_name("flags remove");
case MODIFY_REPLACE:
doveadm_mail_help_name("flags replace");
}
i_unreached();
}
if (str[0] == '\\') {
if (flag == 0)
} else {
}
}
}
}
static struct doveadm_mail_cmd_context *
{
struct flags_cmd_context *ctx;
}
static struct doveadm_mail_cmd_context *cmd_flags_add_alloc(void)
{
return cmd_flag_alloc(MODIFY_ADD);
}
static struct doveadm_mail_cmd_context *cmd_flags_remove_alloc(void)
{
return cmd_flag_alloc(MODIFY_REMOVE);
}
static struct doveadm_mail_cmd_context *cmd_flags_replace_alloc(void)
{
return cmd_flag_alloc(MODIFY_REPLACE);
}
struct doveadm_cmd_ver2 doveadm_cmd_flags_add_ver2 = {
.name = "flags add",
DOVEADM_CMD_PARAM('\0', "flagstr", CMD_PARAM_STR, CMD_PARAM_FLAG_POSITIONAL|CMD_PARAM_FLAG_DO_NOT_EXPOSE)
};
struct doveadm_cmd_ver2 doveadm_cmd_flags_remove_ver2 = {
.name = "flags remove",
DOVEADM_CMD_PARAM('\0', "flagstr", CMD_PARAM_STR, CMD_PARAM_FLAG_POSITIONAL|CMD_PARAM_FLAG_DO_NOT_EXPOSE)
};
struct doveadm_cmd_ver2 doveadm_cmd_flags_replace_ver2 = {
.name = "flags replace",
DOVEADM_CMD_PARAM('\0', "flagstr", CMD_PARAM_STR, CMD_PARAM_FLAG_POSITIONAL|CMD_PARAM_FLAG_DO_NOT_EXPOSE)
};