From 687ba0e2488db45147a2b7ea78bed3f7f4e57695 Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Mon, 22 Jan 2018 20:05:09 +0100 Subject: [PATCH] Verify mailbox against username instead of email --- src/ldap.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ldap.js b/src/ldap.js index 76001e51f..a0ee15f79 100644 --- a/src/ldap.js +++ b/src/ldap.js @@ -441,7 +441,7 @@ function authenticateMailbox(req, res, next) { return res.end(); }); } else if (mailbox.ownerType === mailboxdb.TYPE_USER) { - user.verifyWithEmail(email, req.credentials || '', function (error, user) { + user.verifyWithUsername(parts[0], req.credentials || '', function (error, user) { if (error && error.reason === UserError.NOT_FOUND) return next(new ldap.NoSuchObjectError(req.dn.toString())); if (error && error.reason === UserError.WRONG_PASSWORD) return next(new ldap.InvalidCredentialsError(req.dn.toString())); if (error) return next(new ldap.OperationsError(error.message));