From 318d01f177451a82393f25cedabfa3bd08575395 Mon Sep 17 00:00:00 2001 From: mscdex Date: Sun, 13 Jan 2013 13:38:08 -0500 Subject: [PATCH] discard any double quotes for strings in BODYs in untagged FETCH responses --- lib/imap.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/imap.js b/lib/imap.js index 89de0ec..eddcebe 100644 --- a/lib/imap.js +++ b/lib/imap.js @@ -24,6 +24,7 @@ var CRLF = '\r\n', RE_LITHEADER = /(?:((?:BODY\[.*\](?:<\d+>)?)?|[^ ]+) )?\{(\d+)\}$/i, RE_UNRESP = /^\* (OK|PREAUTH|NO|BAD) (?:\[(.+)\] )?(.+)$/i, //RE_ISPARTIAL = /<(\d+)>$/, + 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) (?:\\[(?.+)\\] )?(?.+)))$', 'i'), @@ -210,13 +211,13 @@ ImapConnection.prototype.connect = function(loginCb) { } function emitLitData(key, data) { - var fetches = requests[0].fetchers[key]; + var fetches = requests[0].fetchers[key.replace(RE_DBLQ, '')]; for (var i=0, len=fetches.length; i