welcome-plugin.c revision 769cf5a48f5b1bf18059264fd165d7593a4ebbd9
/* Copyright (c) 2015-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "net.h"
#include "str.h"
#include "strescape.h"
#include "eacces-error.h"
#include "write-full.h"
#include "module-context.h"
#include "mail-storage-private.h"
#define WELCOME_SOCKET_TIMEOUT_SECS 30
#define WELCOME_CONTEXT(obj) \
struct welcome_mailbox {
union mailbox_module_context module_ctx;
bool created;
};
{
const char *socket_path, *const *args;
char buf[1024];
if (user->mail_debug)
socket_path = args[0];
args++;
if (*socket_path != '/') {
socket_path, NULL);
}
i_error("welcome: %s",
eacces_error_get("net_connect_unix",
socket_path));
} else {
i_error("welcome: net_connect_unix(%s) failed: %m",
}
return;
}
if (!wait)
else
}
else if (wait) {
if (ret < 0)
else if (ret < 2)
else if (buf[0] != '+')
}
}
static int
{
return -1;
/* the mailbox isn't fully created here yet, so just mark it as created
and wait until open() time to actually run it */
return 0;
}
{
const char *cmd;
"welcome_wait");
}
}
{
struct welcome_mailbox *wbox;
if (!box->inbox_user)
return;
v->create_box = welcome_create_box;
v->open = welcome_open_box;
}
static struct mail_storage_hooks welcome_mail_storage_hooks = {
};
void welcome_plugin_deinit(void);
{
}
void welcome_plugin_deinit(void)
{
}
const char *welcome_plugin_version = DOVECOT_ABI_VERSION;