mail-listener2
mail-listener2 copied to clipboard
Cannot read property 'bodyEmitter' of undefined
I've been having some issues the listener, where it sometimes gets disconnected. I've put up a retry mechanism, where upon 'server:disconnected' it retries to connect (.start() command) every 1 minute, but then I see the logs stacked with the following error (seems intermittent):
info: IMAP disconnected, retrying...
info: Restarting IMAP connection. [retries=1]
info: Restarting IMAP connection. [retries=2]
info: Restarting IMAP connection. [retries=3]
info: Restarting IMAP connection. [retries=4]
error: uncaughtException: Cannot read property 'bodyEmitter' of undefined
stack:
[ 'TypeError: Cannot read property 'bodyEmitter' of undefined',
' at Connection._resTagged (../node_modules/mail-listener2/node_modules/imap/lib/Connection.js:1484:10)',
' at Parser.
What could cause this? should I be retrying differently? recreate MailListener object?