From 3997f92ee13080b0f1562459835f8370cbc278bf Mon Sep 17 00:00:00 2001 From: Brian White Date: Thu, 12 Apr 2012 12:31:07 -0400 Subject: [PATCH] Fix plain-text logins Fixes #54 --- imap.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imap.js b/imap.js index 68a43c0..7845e52 100644 --- a/imap.js +++ b/imap.js @@ -958,9 +958,9 @@ ImapConnection.prototype._login = function(cb) { if (this.capabilities.indexOf('LOGINDISABLED') > -1) return cb(new Error('Logging in is disabled on this server')); - if (this.capabilities.indexOf('AUTH=XOAUTH') >= 0 && 'xoauth' in this._options) + if (this.capabilities.indexOf('AUTH=XOAUTH') !== -1 && 'xoauth' in this._options) this._send('AUTHENTICATE XOAUTH ' + escape(this._options.xoauth), fnReturn); - else if (this._state.capabilities['AUTH=PLAIN'] !== undefined) { + else if (this.capabilities.indexOf('AUTH=PLAIN') !== -1) { this._send('LOGIN "' + escape(this._options.username) + '" "' + escape(this._options.password) + '"', fnReturn); } else {