diff --git a/lib/handlers/on-store.js b/lib/handlers/on-store.js index e335629c..ded75809 100644 --- a/lib/handlers/on-store.js +++ b/lib/handlers/on-store.js @@ -157,12 +157,12 @@ module.exports = server => (mailbox, update, session, callback) => { } if (queryAll && !session.selected.uidList.includes(message.uid)) { // skip processing messages that we do not know about yet - return processNext(); + return setImmediate(processNext); } if (update.unchangedSince && message.modseq > update.unchangedSince) { modified.push(message.uid); - return processNext(); + return setImmediate(processNext); } let flagsupdate = false; // query object for updates @@ -389,21 +389,21 @@ module.exports = server => (mailbox, update, session, callback) => { server.notifier.addEntries(mailboxData, notifyEntries, () => { notifyEntries = []; server.notifier.fire(session.user.id); - processNext(); + return setImmediate(processNext); }); } ); } else { - processNext(); + return setImmediate(processNext); } }); } else { - processNext(); + return setImmediate(processNext); } }); }; - processNext(); + return setImmediate(processNext); } ); }; diff --git a/package.json b/package.json index 538532c4..75471281 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wildduck", - "version": "1.4.17", + "version": "1.4.18", "description": "IMAP/POP3 server built with Node.js and MongoDB", "main": "server.js", "scripts": {