From 037fcc2fffccf6e385f49a9576721392958a4bf1 Mon Sep 17 00:00:00 2001 From: mscdex Date: Mon, 18 Mar 2013 00:34:34 -0400 Subject: [PATCH] ignore untagged OK responses that contain no other information --- lib/imap.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/imap.js b/lib/imap.js index 14eb96c..6acee4e 100644 --- a/lib/imap.js +++ b/lib/imap.js @@ -23,7 +23,7 @@ var CRLF = '\r\n', BOXSELECTED: 4 }, RE_LITHEADER = /(?:((?:BODY\[.*\](?:<\d+>)?)?|[^ ]+) )?\{(\d+)\}$/i, - RE_UNRESP = /^\* (OK|PREAUTH|NO|BAD) (?:\[(.+)\] )?(.+)$/i, + RE_UNRESP = /^\* (OK|PREAUTH|NO|BAD)(?:\r\n| (?:\[(.+)\] )?(.+))$/i, //RE_ISPARTIAL = /<(\d+)>$/, RE_DBLQ = /"/g, RE_CMD = /^([^ ]+)(?: |$)/, @@ -532,6 +532,8 @@ ImapConnection.prototype.connect = function(loginCb) { switch (m[1]) { case 'OK': var code = m[2]; + if (code === undefined) + break; if (state.status === STATES.NOAUTH) { if (!state.isReady) { clearTimeout(state.tmrConn);