doveadm-util.c revision 6a33ecc05e60b511c1ae176ef113546e1012c18f
/* Copyright (c) 2009-2013 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "net.h"
#include "time-util.h"
#include "master-service.h"
#include "module-dir.h"
#include "doveadm-settings.h"
#include "doveadm-mail.h"
#include "doveadm-util.h"
#include <time.h>
#include <dirent.h>
void doveadm_load_modules(void)
{
struct module_dir_load_settings mod_set;
/* some doveadm plugins have dependencies to mail plugins. we can load
only those whose dependencies have been loaded earlier, the rest are
ignored. */
}
void doveadm_unload_modules(void)
{
}
bool doveadm_has_unloaded_plugin(const char *name)
{
struct dirent *d;
const char *plugin_name;
/* first check that it's not actually loaded */
return FALSE;
}
return FALSE;
plugin_name += 8;
break;
}
}
return found;
}
{
}
const char *doveadm_plugin_getenv(const char *name)
{
const char *const *envs;
unsigned int i, count;
return NULL;
for (i = 0; i < count; i += 2) {
return envs[i+1];
}
return NULL;
}
static bool
{
const char *p;
/* host:port */
if (p == NULL && default_port != 0) {
*port_r = default_port;
} else {
return FALSE;
}
return TRUE;
}
static int
{
unsigned int ips_count;
if (ret != 0) {
i_fatal("Lookup of host %s failed: %s",
}
if (fd == -1) {
i_fatal("connect(%s:%u) failed: %m",
}
return fd;
}
{
const char *host;
unsigned int port;
i_fatal("Port not known for %s. Either set proxy_port "
}
}
int doveadm_connect_with_default_port(const char *path,
unsigned int default_port)
{
int fd;
/* we'll assume UNIX sockets typically have an absolute path,
or at the very least '/' somewhere. */
else {
if (fd == -1)
return -1;
}
return fd;
}
int doveadm_connect(const char *path)
{
return doveadm_connect_with_default_port(path, 0);
}