Mail event
imap.on('mail') How to make this trigger email receiving event all the time, because my IMAP connection lasts forever, but om mail event not.
It's only triggered when there's new mail in the mailbox that you currently have open.
@mscdex What happens if the email arrives before imap.on() starts listening - In my observation, imap.on() ignores the email.
I'm running the email code in my test suite to retrieve verification codes and sometimes messages arrives faster than expected. In this case imap.on() still listens for new incoming email and doesn't let to move on for imap.search()
imap.once('ready', function () { openInbox(function (err, box) { if (err) throw err imap.on('mail', function (newMsgNum: number) {}
Thanks!