mirror of
https://github.com/nodemailer/wildduck.git
synced 2024-12-29 11:46:30 +08:00
allow APPEND string args as Buffers
This commit is contained in:
parent
496104d936
commit
05c79b680f
1 changed files with 9 additions and 1 deletions
|
@ -40,7 +40,13 @@ module.exports = {
|
|||
});
|
||||
}
|
||||
|
||||
let path = Buffer.from((command.attributes.shift() || {}).value || 'binary').toString();
|
||||
let path = (command.attributes.shift() || {}).value;
|
||||
if (!Buffer.isBuffer(path)) {
|
||||
path = path.toString();
|
||||
} else {
|
||||
path = Buffer.from(path, 'binary').toString();
|
||||
}
|
||||
|
||||
path = imapTools.normalizeMailbox(path, !this.acceptUTF8Enabled);
|
||||
let message = command.attributes.pop();
|
||||
let flags = [];
|
||||
|
@ -69,6 +75,8 @@ module.exports = {
|
|||
}
|
||||
|
||||
if (internaldate) {
|
||||
internaldate = internaldate.toString(); // might be Buffer
|
||||
|
||||
if (!validateInternalDate(internaldate)) {
|
||||
return callback(new Error('Invalid date argument for APPEND'));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue