/* Copyright (c) 2010-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "str.h"
#include "unichar.h"
#include "imap-utf7.h"
#include "mail-namespace.h"
#include "mail-storage.h"
#include "mail-search-build.h"
#include "doveadm-print.h"
#include "doveadm-mailbox-list-iter.h"
#include "doveadm-mail.h"
#include <stdio.h>
struct doveadm_mailbox_cmd_context {
bool subscriptions;
};
struct mailbox_cmd_context {
};
struct create_cmd_context {
};
struct delete_cmd_context {
bool recursive;
bool require_empty;
bool unsafe;
};
struct rename_cmd_context {
};
struct list_cmd_context {
bool mutf7;
};
struct update_cmd_context {
const char *mailbox;
};
struct path_cmd_context {
const char *mailbox;
};
static const char *mailbox_list_path_type_names[] = {
"dir", "alt-dir", "mailbox", "alt-mailbox",
"control", "index", "index-private"
};
{
unsigned int i;
if (!uni_utf8_str_is_valid(args[i])) {
"Mailbox name not valid UTF-8: %s", args[i]);
}
}
}
{
(struct doveadm_mailbox_cmd_context *)_ctx;
switch (c) {
case 's':
break;
default:
return FALSE;
}
return TRUE;
}
static struct doveadm_mail_cmd_context *
{
return ctx;
}
static bool
{
switch (c) {
case '7':
break;
case '8':
break;
case 's':
break;
default:
return FALSE;
}
return TRUE;
}
static int
{
else {
str_truncate(str, 0);
i_unreached();
}
}
if (doveadm_mailbox_list_iter_deinit(&iter) < 0)
return -1;
return 0;
}
struct mail_search_args *
{
unsigned int i;
else
}
if (i > 1) {
}
return search_args;
}
const char *const args[])
{
}
{
}
{
}
static int
{
const char *const *namep;
int ret = 0;
}
ret = -1;
}
ret = -1;
}
}
mailbox_free(&box);
}
return ret;
}
const char *const args[])
{
const char *name;
unsigned int i;
doveadm_mail_help_name("mailbox create");
}
}
static bool
{
switch (c) {
case 'g':
doveadm_mail_help_name("mailbox create");
break;
case 's':
break;
default:
return FALSE;
}
return TRUE;
}
{
}
{
}
static int
const char *name)
{
}
return mailbox_list_iter_deinit(&iter);
}
static int
{
const char *const *namep;
*namep) < 0) {
ret = -1;
}
if ((*namep)[0] != '\0')
}
}
if (ret2 < 0) {
ret = -1;
}
ret = -1;
}
}
mailbox_free(&box);
}
return ret;
}
const char *const args[])
{
const char *name;
unsigned int i;
doveadm_mail_help_name("mailbox delete");
}
}
static bool
{
switch (c) {
case 'r':
break;
case 's':
break;
case 'e':
break;
case 'Z':
break;
default:
return FALSE;
}
return TRUE;
}
{
}
static int
{
int ret = 0;
ret = -1;
}
ret = -1;
}
ret = -1;
}
}
return ret;
}
const char *const args[])
{
doveadm_mail_help_name("mailbox rename");
}
{
}
static int
{
const char *const *namep;
int ret = 0;
"unsubscribe",
ret = -1;
}
mailbox_free(&box);
}
return ret;
}
const char *const args[])
{
const char *name;
unsigned int i;
"mailbox subscribe" :
"mailbox unsubscribe");
}
}
}
static struct doveadm_mail_cmd_context *
{
}
{
return cmd_mailbox_subscriptions_alloc(TRUE);
}
{
return cmd_mailbox_subscriptions_alloc(FALSE);
}
static
const char *const args[])
{
doveadm_mail_help_name("mailbox update");
"min_first_recent_uid > min_next_uid");
}
}
static
{
switch (c) {
case 'g':
doveadm_mail_help_name("mailbox update");
break;
case 'V':
doveadm_mail_help_name("mailbox update");
break;
case 'N':
doveadm_mail_help_name("mailbox update");
break;
case 'R':
doveadm_mail_help_name("mailbox update");
break;
case 'H':
doveadm_mail_help_name("mailbox update");
break;
case 'P':
doveadm_mail_help_name("mailbox update");
break;
default:
return FALSE;
}
return TRUE;
}
static
{
int ret = 0;
i_error("Cannot update %s: %s",
}
mailbox_free(&box);
return ret;
}
static
{
}
static void
const char *const args[])
{
doveadm_mail_help_name("mailbox path");
}
static bool
enum mailbox_list_path_type *type_r)
{
return TRUE;
}
}
return FALSE;
}
static bool
{
switch (c) {
case 't':
doveadm_mail_help_name("mailbox path");
break;
default:
return FALSE;
}
return TRUE;
}
static int
{
int ret;
if (ret < 0) {
i_error("Failed to lookup mailbox %s path: %s",
} else if (ret > 0) {
}
return ret;
}
{
}
.name = "mailbox list",
};
.name = "mailbox create",
};
.name = "mailbox delete",
};
.name = "mailbox rename",
};
.name = "mailbox subscribe",
};
.name = "mailbox unsubscribe",
};
.name = "mailbox update",
.usage = DOVEADM_CMD_MAIL_USAGE_PREFIX"[--mailbox-guid guid] [--uid-validity uid] [--min-next-uid uid] [--min-first-recent-uid uid] [--min-highest-modseq seq] [--min-highest-pvt-modseq seq] <mailbox>",
};
.name = "mailbox path",
};