mscdex/node-imap — Issue #36: Resetting idle state
Author: brunomorency
Created: 2011-11-22 16:02:22+00:00
State: open

ImapConnection.prototype._reset does not reset _state.ext.idle.sentIdle and _state.ext.idle.timeWaited. If a connection is closed by the server while we are idling and we try to reconnect using the same ImapConnection instance, sentIdle left to true causes this bug:

- Upon successful connection, we're sending a CAPABILITY command
- since _state.ext.idle.sentIdle is true, the _send function will first send a "DONE"
- This causes the server to respond with a "BAD invalid tag" and close the connection again