/* Copyright (c) 2010-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "hash.h"
#include "str.h"
#include "strescape.h"
#include "ioloop.h"
#include "master-service.h"
#include "auth-master.h"
#include "mail-storage.h"
#include "mail-storage-service.h"
#include "server-connection.h"
#include "doveadm-settings.h"
#include "doveadm-print.h"
#include "doveadm-server.h"
#include "doveadm-mail.h"
#define DOVEADM_MAIL_SERVER_FAILED() \
struct doveadm_mail_server_cmd {
char *username;
};
const char *username);
static struct doveadm_server *
{
const char *p;
char *dup_name;
if (!hash_table_is_created(servers)) {
}
}
return server;
}
static struct server_connection *
{
if (server_connection_is_idle(*connp))
return *connp;
}
return NULL;
}
{
if (!server_connection_is_idle(*connp))
return TRUE;
}
return FALSE;
}
void *context)
{
switch (exit_code) {
case 0:
break;
i_error("%s: Command %s failed for %s: %s",
return;
case EX_NOUSER:
break;
default:
break;
}
}
}
}
const char *username)
{
unsigned int i;
/* <flags> <username> <command> [<args>] */
if (doveadm_debug)
else if (doveadm_verbose)
}
}
{
do {
}
static int
const struct mail_storage_service_input *input,
const char **error_r)
{
unsigned int i;
bool proxying;
int ret;
return 0;
/* make sure we have an auth connection */
if (ret < 0) {
"because doveadm_port is set)",
} else if (ret == 0) {
/* user not found from passdb. it could be in userdb though,
so just continue with the default host */
} else {
proxy_port = 0;
}
}
if (proxy_hostip != NULL)
if (!proxying)
ret = 0;
else if (proxy_host == NULL) {
"%s (maybe set auth_socket_path=director-userdb)",
*error_r);
}
ret = -1;
} else {
}
}
pool_unref(&pool);
return ret;
}
const struct mail_storage_service_input *input,
const char **error_r)
{
char *username_dup;
int ret;
if (ret < 0)
return ret;
if (ret == 0 &&
/* run it ourself */
return 0;
}
/* server sends the sticky headers for each row as well,
so undo any sticks we might have added already */
else
} else {
}
*error_r = "doveadm server failure";
}
{
char *key;
break;
}
}
return ret;
}
static void doveadm_servers_destroy_all_connections(void)
{
char *key;
}
}
}
void doveadm_mail_server_flush(void)
{
if (!hash_table_is_created(servers)) {
return;
}
i_error("Aborted");
if (DOVEADM_MAIL_SERVER_FAILED())
}