No timeout when establishing a secure-only conn as non-secure. #50

cloudily opened this Issue Mar 9, 2012 · 3 comments


None yet

2 participants

cloudily commented Mar 9, 2012

Using the gmail example that you have listed on the readme and changing the secure flag to be false, you'll see that it just hangs open:

var ImapConnection = require('./imap').ImapConnection, util = require('util'),
    imap = new ImapConnection({
      username: '',
      password: 'mygmailpassword',
      host: '',
      port: 993,
      secure: false

Not sure if this is the best way to fix, but I added a listener for timeout and moved the timeout into the socket:

  this._state.conn.on("timeout", function() {

  //this._state.tmrConn = setTimeout(this._fnTmrConn.bind(this),
  //                                 this._options.connTimeout, loginCb);

Please let me know if you're seeing the same problem.


cloudily commented Mar 9, 2012

I forgot to note that you must also call


where you're calling


Okay, that doesn't fix it. It's because the timeout gets cleared in the "connect" event. Commenting that out and adding it to the "ready" event seems to fix it but don't know what other issues will arise.

mscdex commented Dec 31, 2012

Fixed in 4e61905.

@mscdex mscdex closed this Dec 31, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment