mirror of
https://github.com/nodemailer/wildduck.git
synced 2025-01-01 13:13:53 +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;
|
let userData;
|
||||||
try {
|
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(
|
userData = await db.users.collection('users').findOne(
|
||||||
{
|
{
|
||||||
unameview: tools.normalizeAddress(username, false, {
|
unameview
|
||||||
removeLabel: true,
|
|
||||||
removeDots: true
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
projection: {
|
projection: {
|
||||||
|
|
Loading…
Reference in a new issue