/* Copyright (c) 2002-2018 Dovecot authors, see the included COPYING file */
/* Thanks to Courier-IMAP for showing how the vpopmail API should be used */
#include "auth-common.h"
#include "userdb.h"
#if defined(PASSDB_VPOPMAIL) || defined(USERDB_VPOPMAIL)
#include "str.h"
#include "var-expand.h"
#include "userdb-vpopmail.h"
struct vpopmail_userdb_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;
}
#endif
#ifdef USERDB_VPOPMAIL
static int
{
*quota_r = "";
return 0;
}
return -1;
return 0;
}
{
(struct vpopmail_userdb_module *)_module;
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;
}
}
"userdb_vpopmail_get_quota(%s, %s) failed: %s",
return;
}
if (*quota != '\0') {
quota);
}
}
static struct userdb_module *
{
const char *const *tmp, *p;
if (p == NULL) {
i_fatal("vpopmail userdb: "
"quota_template missing '='");
}
} else
}
}
"vpopmail",
NULL,
NULL,
NULL,
NULL,
};
#else
.name = "vpopmail"
};
#endif