userdb-vpopmail.c revision 6fabfb7bbfd88d0c1de66981e52850f26067623b
/* Copyright (C) 2002-2003 Timo Sirainen */
/* Thanks to Courier-IMAP for showing how the vpopmail API should be used */
#include "common.h"
#if defined(PASSDB_VPOPMAIL) || defined(USERDB_VPOPMAIL)
#include "str.h"
#include "var-expand.h"
#include "userdb.h"
#include "userdb-vpopmail.h"
struct vpopmail_userdb_module {
struct userdb_module module;
const char *quota_template_key;
const char *quota_template_value;
};
char vpop_user[VPOPMAIL_LIMIT],
char vpop_domain[VPOPMAIL_LIMIT])
{
/* vpop_user must be zero-filled or parse_email() leaves an
extra character after the user name. we'll fill vpop_domain
as well just to be sure... */
VPOPMAIL_LIMIT-1) < 0) {
"parse_email() failed");
return NULL;
}
"lookup user=%s domain=%s",
return NULL;
}
return vpw;
}
#ifdef USERDB_VPOPMAIL
static const char *
{
const struct var_expand_table *tab;
return "";
}
{
struct vpopmail_userdb_module *module =
(struct vpopmail_userdb_module *)_module;
const char *quota;
return;
}
struct vqpasswd isn't really gid at all but just some flags... */
"vget_assign(%s) failed", vpop_domain);
return;
}
if (auth_request->successful) {
/* update the last login only when we're really */
}
/* user's homedir doesn't exist yet, create it */
"pw_dir isn't set, creating");
"make_user_dir(%s, %s) failed",
return;
}
/* get the user again so pw_dir is visible */
return;
}
}
if (*quota != '\0') {
quota);
}
}
static struct userdb_module *
{
struct vpopmail_userdb_module *module;
const char *const *tmp, *p;
if (p == NULL) {
i_fatal("vpopmail userdb: "
"quota_template missing '='");
}
} else
}
}
struct userdb_module_interface userdb_vpopmail = {
"vpopmail",
NULL,
NULL,
};
#endif
#endif