diff --git a/lib/imap.js b/lib/imap.js index 5140a8f..7d43915 100644 --- a/lib/imap.js +++ b/lib/imap.js @@ -162,7 +162,7 @@ ImapConnection.prototype.connect = function(loginCb) { self.emit('close', had_error); }); - state.conn.on('error', function(err) { + socket.on('error', function(err) { clearTimeout(state.tmrConn); err.level = 'socket'; if (state.status === STATES.NOCONNECT)