summaryrefslogtreecommitdiffstats
path: root/sqwebmail/auth.c
diff options
context:
space:
mode:
Diffstat (limited to 'sqwebmail/auth.c')
-rw-r--r--sqwebmail/auth.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sqwebmail/auth.c b/sqwebmail/auth.c
index 7294d7f..ef41568 100644
--- a/sqwebmail/auth.c
+++ b/sqwebmail/auth.c
@@ -169,7 +169,16 @@ static int doauthlogin(struct authinfo *a, void *vp)
const char *do_login(const char *u, const char *p, const char *ip)
{
- if (auth_login("webmail", u, p, doauthlogin, (void *)u))
+ char ipbuf[strlen(ip)+sizeof("TCPREMOTEIP=")];
+ char *envvars[2]={ipbuf, 0};
+ struct auth_meta meta;
+
+ strcat(strcpy(ipbuf, "TCPREMOTEIP="), ip);
+
+ memset(&meta, 0, sizeof(meta));
+ meta.envvars=envvars;
+
+ if (auth_login_meta(&meta, "webmail", u, p, doauthlogin, (void *)u))
{
courier_safe_printf("INFO: LOGIN FAILED, user=%s, ip=[%s]",
u?u:"", ip);