From 12a05501b77ab0e7c55bb7e7ea78d22abbcb9c9d Mon Sep 17 00:00:00 2001 From: Chotiwat Chawannakul Date: Tue, 12 Mar 2013 14:14:29 +0700 Subject: [PATCH] Allow empty mailbox name (e.g. " ") --- lib/imap.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/imap.js b/lib/imap.js index dfdb9ac..4f5f5c6 100644 --- a/lib/imap.js +++ b/lib/imap.js @@ -28,7 +28,7 @@ var CRLF = '\r\n', RE_DBLQ = /"/g, RE_CMD = /^([^ ]+)(?: |$)/, RE_ISHEADER = /HEADER/, - REX_UNRESPDATA = XRegExp('^\\* (?:(?:(?NAMESPACE) (?(?:NIL|\\((?:\\(.+\\))+\\))) (?(?:NIL|\\((?:\\(.+\\))+\\))) (?(?:NIL|\\((?:\\(.+\\))+\\))))|(?:(?FLAGS) \\((?.*)\\))|(?:(?LIST|LSUB|XLIST) \\((?.*)\\) (?".+"|NIL) (?.+))|(?:(?(SEARCH|SORT))(?: (?.*))?)|(?:(?STATUS) (?.+) \\((?.*)\\))|(?:(?CAPABILITY) (?.+))|(?:(?BYE) (?:\\[(?.+)\\] )?(?.+)))[ \t]*(?:\r\n|$)', 'i'), + REX_UNRESPDATA = XRegExp('^\\* (?:(?:(?NAMESPACE) (?(?:NIL|\\((?:\\(.+\\))+\\))) (?(?:NIL|\\((?:\\(.+\\))+\\))) (?(?:NIL|\\((?:\\(.+\\))+\\))))|(?:(?FLAGS) \\((?.*)\\))|(?:(?LIST|LSUB|XLIST) \\((?.*)\\) (?"[^"]+"|NIL) (?.+))|(?:(?(SEARCH|SORT))(?: (?.*))?)|(?:(?STATUS) (?.+) \\((?.*)\\))|(?:(?CAPABILITY) (?.+))|(?:(?BYE) (?:\\[(?.+)\\] )?(?.+)))[ \t]*(?:\r\n|$)', 'i'), REX_UNRESPNUM = XRegExp('^\\* (?\\d+) (?:(?EXISTS)|(?RECENT)|(?EXPUNGE)|(?:(?FETCH) \\((?.*)\\)))[ \t]*(?:\r\n|$)', 'i'); // extension constants @@ -452,7 +452,7 @@ ImapConnection.prototype.connect = function(loginCb) { curChildren = requests[0].cbargs[0]; if (box.delimiter) { - var path = name.split(box.delimiter).filter(utils.isNotEmpty), + var path = name.split(box.delimiter), parent = null; name = path.pop(); for (i=0,len=path.length; i