mirror of
https://github.com/nodemailer/wildduck.git
synced 2024-12-29 19:51:17 +08:00
Update users.js
if username not includes "@" or not an email, tools.normalizeAddress() function not working correctly.
This commit is contained in:
parent
8aee41f98a
commit
b92ffe897f
1 changed files with 13 additions and 4 deletions
|
@ -583,12 +583,21 @@ module.exports = (db, server, userHandler, settingsHandler) => {
|
|||
|
||||
let userData;
|
||||
try {
|
||||
|
||||
let unameview = ''
|
||||
if(username.includes("@")){
|
||||
unameview = tools.normalizeAddress(username, false, {
|
||||
removeLabel: true,
|
||||
removeDots: true
|
||||
})
|
||||
}
|
||||
else{
|
||||
unameview = username.replace(/\./g, '')
|
||||
}
|
||||
|
||||
userData = await db.users.collection('users').findOne(
|
||||
{
|
||||
unameview: tools.normalizeAddress(username, false, {
|
||||
removeLabel: true,
|
||||
removeDots: true
|
||||
})
|
||||
unameview
|
||||
},
|
||||
{
|
||||
projection: {
|
||||
|
|
Loading…
Reference in a new issue