/* Copyright (c) 2009-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "str.h"
#include "sort.h"
#include "ostream.h"
#include "env-util.h"
#include "execv-const.h"
#include "dict.h"
#include "master-service-private.h"
#include "master-service-settings.h"
#include "settings-parser.h"
#include "doveadm-print-private.h"
#include "doveadm-dump.h"
#include "doveadm-mail.h"
#include "doveadm-settings.h"
#include "doveadm-dsync.h"
#include "doveadm.h"
#include <unistd.h>
};
int doveadm_exit_code = 0;
{
switch (fatal_status) {
case FATAL_LOGWRITE:
case FATAL_LOGERROR:
case FATAL_LOGOPEN:
case FATAL_OUTOFMEM:
case FATAL_EXEC:
case FATAL_DEFAULT:
*status = EX_TEMPFAIL;
break;
}
}
static void
{
const char **lines;
unsigned int i, count;
/* split lines */
/* sort lines */
/* print lines, compress subcommands into a single line */
for (i = 0; i < count; i++) {
args = "";
} else {
args++;
}
if (*prefix != '\0') {
continue;
}
if (p == NULL) {
if (*prev_name != '\0') {
prev_name = "";
}
} else {
if (*prev_name != '\0')
prev_sub_name = "";
} else {
}
}
}
}
if (*prev_name != '\0')
}
static void ATTR_NORETURN
{
if (*prefix != '\0')
}
void usage(void)
{
}
static void ATTR_NORETURN
{
}
{
}
static void ATTR_NORETURN
{
}
{
}
{
man_argv[0] = "man";
}
};
{
}
};
};
{
argv++;
}
const char *const argv[])
{
return FALSE;
return TRUE;
}
{
return TRUE;
}
return TRUE;
}
return doveadm_mail_has_subcommands(cmd_name);
}
static void doveadm_read_settings(void)
{
};
const char *error;
}
};
{
const char *cmd_name;
unsigned int i;
int c;
/* "+" is GNU extension to stop at the first non-option.
others just accept -+ option. */
while ((c = master_getopt(master_service)) > 0) {
switch (c) {
case 'D':
break;
case 'f':
break;
case 'h':
break;
case 'v':
break;
default:
return FATAL_DEFAULT;
}
}
/* "help cmd" doesn't need any configuration */
quick_init = TRUE;
} else {
}
for (i = 0; i < N_ELEMENTS(doveadm_cmdline_commands); i++)
/* special case commands: even if there is something wrong
with the config (e.g. mail_plugins), don't fail these
commands */
quick_init = TRUE;
} else {
quick_init = FALSE;
/* show usage after registering all plugins */
}
}
if (!doveadm_debug) {
/* disable debugging unless -D is given */
i_set_debug_file("/dev/null");
}
/* this has to be done here because proctitle hack can break
the env pointer */
if (doveadm_has_unloaded_plugin(cmd_name)) {
i_fatal("Unknown command '%s', but plugin %s exists. "
"Try to set mail_plugins=%s",
}
usage();
}
if (!quick_init) {
}
return doveadm_exit_code;
}