node-imap
node-imap copied to clipboard
mail event does not fire
We've tried several implementations of getting the mail event to fire with no luck. Trying to leave the box open doesn't help nor does closing it. Can you provide a working example of the mail event firing?
it seems that <= '* {num} RECENT' event will not fire the 'mail' event (which I think it should) caused this problem. Could you please check edit Connection.js around L 1021 to sth like this:
else if (type === 'recent') {
if (!this._box && RE_OPENBOX.test(this._curReq.type))
this._createCurrentBox()
if (this._box) {
this._box.messages.new = info.num
if (info.num > 0 && this.state === 'authenticated') {
this.emit('mail', this._box.messages.new)
}
}
}
will make it fire events as expected?