doveadm.c revision c6335901c67a4c9365319190a111a2168f3b06f5
/* Copyright (c) 2009 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "lib-signals.h"
#include "ioloop.h"
#include "env-util.h"
#include "master-service.h"
#include "mail-user.h"
#include "mail-namespace.h"
#include "mail-storage.h"
#include "mail-storage-settings.h"
#include "mail-storage-service.h"
#include <stdio.h>
#include <stdlib.h>
static int killed_signo = 0;
static void ATTR_NORETURN
usage(void)
{
"usage: doveadm \n"
" purge <user>\n"
" force-resync <user> <mailbox>\n"
);
}
{
}
{
struct mail_namespace *ns;
continue;
}
}
}
static struct mailbox *
{
struct mail_namespace *ns;
struct mail_storage *storage;
const char *orig_mailbox = mailbox;
}
return box;
}
{
struct mail_storage *storage;
usage();
MAILBOX_SYNC_FLAG_FIX_INCONSISTENT, 0, NULL) < 0) {
}
mailbox_close(&box);
}
char *args[])
{
else
usage();
}
static void
{
struct mail_storage_service_input input;
i_fatal("USER environment is missing and -u option not used");
}
static int
const struct mail_storage_service_input *input,
{
const char *error;
int ret;
&multi_user, &error);
if (ret <= 0) {
if (ret == 0) {
i_info("User no longer exists, skipping");
return 0;
} else {
return -1;
}
}
return -1;
}
return 0;
}
static void
{
struct mail_storage_service_input input;
struct mail_storage_service_multi_ctx *multi;
const char *user;
int ret;
n = user_count / 10000;
n /= 10;
user_idx = 0;
T_BEGIN {
} T_END;
if (ret < 0)
break;
if ((service_flags & MAIL_STORAGE_SERVICE_FLAG_DEBUG) != 0) {
}
}
if (killed_signo != 0) {
ret = -1;
break;
}
}
if ((service_flags & MAIL_STORAGE_SERVICE_FLAG_DEBUG) != 0)
printf("\n");
i_set_failure_prefix("doveadm: ");
if (ret < 0)
i_error("Failed to iterate through some users");
pool_unref(&pool);
}
{
enum mail_storage_service_flags service_flags = 0;
struct master_service *service;
const char *getopt_str, *username;
int c;
switch (c) {
case 'a':
break;
case 'u':
break;
case 'v':
break;
default:
usage();
}
}
usage();
if (!all_users) {
} else {
}
return 0;
}