|
|
|
@ -1157,10 +1157,13 @@ ImapConnection.prototype._store = function(which, uids, flags, isAdding, cb) {
|
|
|
|
|
flags = [flags];
|
|
|
|
|
for (var i=0; i<flags.length; i++) {
|
|
|
|
|
if (!isKeywords) {
|
|
|
|
|
if (flags[i][0] === '\\')
|
|
|
|
|
flags[i] = flags[i].substr(1);
|
|
|
|
|
if (this._state.box.permFlags.indexOf(flags[i]) === -1
|
|
|
|
|
|| flags[i] === '\\*' || flags[i] === '*')
|
|
|
|
|
|| flags[i] === '*')
|
|
|
|
|
throw new Error('The flag "' + flags[i]
|
|
|
|
|
+ '" is not allowed by the server for this mailbox');
|
|
|
|
|
flags[i] = '\\' + flags[i];
|
|
|
|
|
} else {
|
|
|
|
|
// keyword contains any char except control characters (%x00-1F and %x7F)
|
|
|
|
|
// and: '(', ')', '{', ' ', '%', '*', '\', '"', ']'
|
|
|
|
@ -1170,8 +1173,6 @@ ImapConnection.prototype._store = function(which, uids, flags, isAdding, cb) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!isKeywords)
|
|
|
|
|
flags = flags.map(function(flag) {return '\\' + flag;});
|
|
|
|
|
flags = flags.join(' ');
|
|
|
|
|
cb = arguments[arguments.length-1];
|
|
|
|
|
|
|
|
|
|