/* Copyright (c) 2010-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "mail-index.h"
#include "mail-storage.h"
#include "mail-namespace.h"
#include "doveadm-mailbox-list-iter.h"
#include "doveadm-mail-iter.h"
#include "doveadm-mail.h"
struct altmove_cmd_context {
bool reverse;
};
static int
const struct mailbox_info *info,
{
&iter) < 0)
return -1;
if (doveadm_debug) {
i_debug("altmove: box=%s uid=%u",
}
}
return doveadm_mail_iter_deinit_sync(&iter);
}
static int
struct mail_storage *storage)
{
if (mail_storage_purge(storage) < 0) {
return -1;
}
return 0;
}
static int
{
unsigned int i, count;
int ret = 0;
if (ns_storage != prev_storage) {
if (prev_storage != NULL) {
ret = -1;
&prev_storage, 1);
}
}
ret = -1;
} T_END;
if (doveadm_mailbox_list_iter_deinit(&iter) < 0)
ret = -1;
if (prev_storage != NULL) {
ret = -1;
}
/* make sure all private storages have been purged */
continue;
for (i = 0; i < count; i++) {
if (ns_storage == storages[i])
break;
}
if (i == count) {
ret = -1;
}
}
return ret;
}
const char *const args[])
{
doveadm_mail_help_name("altmove");
}
static bool
{
switch (c) {
case 'r':
break;
default:
return FALSE;
}
return TRUE;
}
{
}
.name = "altmove",
};