mail-user.c revision 9fd2181788a61500641c66aec0f8c746b19bf830
/* Copyright (c) 2008-2012 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "hostpid.h"
#include "net.h"
#include "module-dir.h"
#include "home-expand.h"
#include "safe-mkstemp.h"
#include "str.h"
#include "strescape.h"
#include "var-expand.h"
#include "settings-parser.h"
#include "auth-master.h"
#include "master-service.h"
#include "mountpoint-list.h"
#include "dict.h"
#include "mail-storage-settings.h"
#include "mail-storage-private.h"
#include "mail-storage-service.h"
#include "mail-namespace.h"
#include "mail-storage.h"
#include "mail-user.h"
#include <stdlib.h>
struct mail_user_module_register mail_user_module_register = { 0 };
{
}
}
const struct setting_parser_info *set_info,
const struct mail_user_settings *set)
{
const char *error;
/* check settings so that the duplicated structure will again
contain the parsed fields */
return user;
}
static int
{
unsigned int i, count;
return 0;
for (i = 0; i < count; i += 2) {
"userdb didn't return a home directory, "
"but plugin setting %s used it (%%h): %s",
return -1;
}
str_truncate(str, 0);
}
return 0;
}
{
const struct mail_storage_settings *mail_set;
bool need_home_dir;
/* expand mail_home setting before calling mail_user_get_home() */
"userdb didn't return a home directory, "
return -1;
}
return -1;
return -1;
}
return 0;
}
{
}
{
return;
}
/* call deinit() with refcount=1, otherwise we may assert-crash in
mail_user_ref() that is called by some deinit() handler. */
}
{
struct mail_namespace *ns;
}
return NULL;
}
{
}
}
}
const struct var_expand_table *
{
static struct var_expand_table static_tab[] = {
};
struct var_expand_table *tab;
/* use a cached table, unless home directory has been set afterwards */
return user->var_expand_table;
return user->var_expand_table;
}
{
}
struct mail_namespace **namespaces)
{
break;
}
}
}
{
}
}
{
return path;
}
{
struct auth_user_info info;
struct auth_user_reply reply;
int ret;
if (mail_user_auth_master_conn == NULL)
return 0;
if (ret > 0) {
}
return ret;
}
{
int ret;
if (user->home_looked_up) {
}
if (ret < 0)
return -1;
/* no home in userdb, fallback to mail_home setting */
}
}
{
const char *const *plugins;
bool ret;
T_BEGIN {
} T_END;
return ret;
}
{
}
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;
}
{
if (*path != '~') {
/* no need to expand home */
return 0;
}
return -1;
return -1;
return 0;
}
const struct mail_user_settings *set)
{
}
{
return NULL;
}
const char **error_r)
{
struct mountpoint_list_rec *rec;
const char *mounts_path;
} else {
}
/* we don't have any knowledge of this path's mountpoint.
assume it's fine. */
return TRUE;
}
/* record exists for this mountpoint. see if it's mounted */
"Mount it or remove it with doveadm mount remove",
rec->mount_path);
return FALSE;
}
return TRUE;
}
static void
{
struct module_dir_load_settings mod_set;
/* initialize the module (and only this module!) immediately so that
the class gets registered */
if (!module->initialized) {
}
break;
}
}
}
struct mail_storage *
{
struct mail_storage *storage;
return storage;
/* it's implemented by a plugin. load it and check again. */
i_error("Storage driver '%s' exists as a stub, "
"but its plugin couldn't be loaded", name);
return NULL;
}
return storage;
}