From caff5aa7646fa1c042b51f9fabc3f87654abeb36 Mon Sep 17 00:00:00 2001 From: Brian White Date: Thu, 3 Jan 2013 23:39:10 -0500 Subject: [PATCH] fix BODY[] parsing --- lib/imap.parsers.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/imap.parsers.js b/lib/imap.parsers.js index 27e6824..42d14b8 100644 --- a/lib/imap.parsers.js +++ b/lib/imap.parsers.js @@ -80,7 +80,9 @@ exports.parseFetchBodies = function(str, literals) { bodies; for (var i=0,len=result.length; i 1) { + if (result[i].length === 0) + result[i].push(''); + else if (result[i].length > 1) { // HEADER.FIELDS (foo) result[i][0] += ' ('; result[i][0] += result[i].slice(1).join(' ');