diff --git a/lib/Connection.js b/lib/Connection.js index f33ef4b..4b2cd5c 100644 --- a/lib/Connection.js +++ b/lib/Connection.js @@ -259,8 +259,13 @@ Connection.prototype.append = function(data, options, cb) { if (options.flags) { if (!Array.isArray(options.flags)) options.flags = [options.flags]; - if (options.flags.length > 0) - cmd += ' (\\' + options.flags.join(' \\') + ')'; + if (options.flags.length > 0) { + for (var i = 0, len = options.flags.length; i < len; ++i) { + if (options.flags[i][0] !== '\\') + options.flags[i] = '\\' + options.flags[i]; + } + cmd += ' (' + options.flags.join(' ') + ')'; + } } if (options.date) { if (!isDate(options.date))