mirror of
https://github.com/nodemailer/wildduck.git
synced 2025-09-13 08:34:53 +08:00
fixed broken SEARCH UID response
This commit is contained in:
parent
d1420bc74b
commit
7a4e9514ef
1 changed files with 9 additions and 0 deletions
|
@ -29,7 +29,11 @@ module.exports = server => (mailbox, options, session, callback) => {
|
|||
mailbox: mailboxData._id
|
||||
};
|
||||
|
||||
let returned = false;
|
||||
let walkQuery = (parent, ne, node) => {
|
||||
if (returned) {
|
||||
return;
|
||||
}
|
||||
node.forEach(term => {
|
||||
switch (term.key) {
|
||||
case 'all':
|
||||
|
@ -92,6 +96,7 @@ module.exports = server => (mailbox, options, session, callback) => {
|
|||
if (Array.isArray(term.value)) {
|
||||
if (!term.value.length) {
|
||||
// trying to find a message that does not exist
|
||||
returned = true;
|
||||
return callback(null, {
|
||||
uidList: [],
|
||||
highestModseq: 0
|
||||
|
@ -324,6 +329,10 @@ module.exports = server => (mailbox, options, session, callback) => {
|
|||
|
||||
let $and = [];
|
||||
walkQuery($and, false, options.query);
|
||||
if (returned) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($and.length) {
|
||||
query.$and = $and;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue