node-imap icon indicating copy to clipboard operation
node-imap copied to clipboard

I want to have this be always on

Open rdgauthier opened this issue 5 years ago • 1 comments

In the examples it is only a single connection then an end. How should I deal with having a constant conneciton. If I just use imap.connect() and never close it, At some point I get some sort of disconnection/error. The most recent one I had was this:

Error: read ECONNRESET
    at TCP.onStreamRead (internal/stream_base_commons.js:205:27) {
  errno: 'ECONNRESET',
  code: 'ECONNRESET',
  syscall: 'read',
  source: 'socket'
}

Unsure how or why this happened, it was just passively running, no new email had come in and I obviously didnt end the connection at all. Any recommendations?

rdgauthier avatar Aug 28 '20 07:08 rdgauthier

The connection was abruptly severed, possibly by the server. You can handle it by adding an 'error' event handler on the connection object.

mscdex avatar Aug 28 '20 15:08 mscdex