From 570a57dc1515a87a27c3ba17069a76c46594e576 Mon Sep 17 00:00:00 2001 From: Brian White Date: Fri, 20 Apr 2012 23:21:10 -0400 Subject: [PATCH] Do not check for 'AUTH=PLAIN' capability when attempting to do plain-text authentication. As per RFC 3501, all IMAP servers must implement at least plain-text authentication, whether they advertise the capability or not. --- imap.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/imap.js b/imap.js index 1248df8..03dbc9c 100644 --- a/imap.js +++ b/imap.js @@ -960,9 +960,8 @@ ImapConnection.prototype._login = function(cb) { if (this.capabilities.indexOf('AUTH=XOAUTH') !== -1 && 'xoauth' in this._options) this._send('AUTHENTICATE XOAUTH ' + escape(this._options.xoauth), fnReturn); - else if (this.capabilities.indexOf('AUTH=PLAIN') !== -1 || - // Kludge due to GMail no longer advertising plaintext auth ... - this.capabilities.indexOf('X-GM-EXT-1') !== -1) { + else if (this._options.username !== undefined && + this._options.password !== undefined) { this._send('LOGIN "' + escape(this._options.username) + '" "' + escape(this._options.password) + '"', fnReturn); } else {