From 9950b29876ba0ba13d727050efb04459696818e7 Mon Sep 17 00:00:00 2001 From: Mike Mee Date: Tue, 19 Mar 2013 14:47:19 -0700 Subject: [PATCH] Fix append with empty flags array --- lib/imap.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/imap.js b/lib/imap.js index 7d43915..2ff26e9 100644 --- a/lib/imap.js +++ b/lib/imap.js @@ -845,7 +845,8 @@ ImapConnection.prototype.append = function(data, options, cb) { if (options.flags) { if (!Array.isArray(options.flags)) options.flags = [options.flags]; - cmd += " (\\" + options.flags.join(' \\') + ")"; + if (options.flags.length > 0) + cmd += " (\\" + options.flags.join(' \\') + ")"; } if (options.date) { if (!isDate(options.date))