node-imap
node-imap copied to clipboard
I want to have this be always on
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?
The connection was abruptly severed, possibly by the server. You can handle it by adding an 'error' event handler on the connection object.