/* 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 "passdb.h"
#ifdef PASSDB_VPOPMAIL
#include "safe-memset.h"
#include "password-scheme.h"
#include "auth-cache.h"
#include "userdb-vpopmail.h"
/* pw_flags was added in vpopmail 5.4, olders use pw_gid field */
#ifndef VQPASSWD_HAS_PW_FLAGS
#endif
struct vpopmail_passdb_module {
};
{
(struct vpopmail_passdb_module *)_module;
/* IMAP from webmail IP may still be allowed */
return TRUE;
}
return TRUE;
}
}
return TRUE;
return TRUE;
return FALSE;
}
static char *
enum passdb_result *result_r)
{
char *password;
return NULL;
}
"%s disabled in vpopmail for this user",
} else {
} else if (!*cleartext)
else
}
}
return password;
}
{
char *password;
return;
}
}
static void
{
char *crypted_pass;
int ret;
if (crypted_pass == NULL) {
return;
}
if (cleartext)
scheme = "CLEARTEXT";
else {
}
if (ret <= 0) {
return;
}
#ifdef POP_AUTH_OPEN_RELAY
/* vpopmail 5.4 does not understand IPv6 */
/* use putenv() directly rather than env_put() which
would leak memory every time we got here. use a
static buffer for putenv() as SUSv2 requirements
would otherwise corrupt our environment later. */
"TCPREMOTEIP=%s", host);
}
}
#endif
}
static struct passdb_module *
{
const char *const *tmp;
i_fatal("vpopmail: Invalid webmail IP address");
} else {
}
}
if (!vauth_load_initialized) {
if (vauth_open(0) != 0)
i_fatal("vpopmail: vauth_open() failed");
}
}
{
vclose();
}
"vpopmail",
NULL,
};
#else
.name = "vpopmail"
};
#endif