diff --git a/imap.js b/imap.js index d5e719db..fefdd09a 100644 --- a/imap.js +++ b/imap.js @@ -1797,7 +1797,10 @@ function clearExpiredMessages() { }).project({ _id: true, mailbox: true, - uid: true + uid: true, + size: true, + map: true, + magic: true }); let deleted = 0; diff --git a/lib/message-handler.js b/lib/message-handler.js index a0a776f9..190c2c3e 100644 --- a/lib/message-handler.js +++ b/lib/message-handler.js @@ -441,7 +441,15 @@ class MessageHandler { if (options.message) { return next(null, options.message); } - this.database.collection('messages').findOne(options.query, next); + this.database.collection('messages').findOne(options.query, { + fields: { + mailbox: true, + uid: true, + size: true, + map: true, + magic: true + } + }, next); }; getMessage((err, message) => { diff --git a/package.json b/package.json index 9feca6d1..0e1d0714 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wildduck", - "version": "1.0.36", + "version": "1.0.37", "description": "IMAP server built with Node.js and MongoDB", "main": "server.js", "scripts": {