skip deleted mails

This commit is contained in:
Girish Ramakrishnan 2016-06-23 15:35:39 -05:00
parent 485b07f797
commit d000e36ed7

View File

@ -155,6 +155,8 @@ ImapProbe.prototype._scanBox = function (needle, callback) {
that._fetchMessage(box.messages.total--, function (error, message) {
if (error) return iteratorCallback(error);
if (message.attributes.flags.indexOf('\\Deleted') !== -1) return iteratorCallback(); // skip deleted
if (!searchMessage(message, needle)) return iteratorCallback(); // continue to next message
matchedMessage = message;