@bobfrankston/iflow 1.0.48 → 1.0.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/imaplib/imap-native.js +6 -1
- package/package.json +1 -1
package/imaplib/imap-native.js
CHANGED
|
@@ -485,8 +485,13 @@ export class NativeImapClient {
|
|
|
485
485
|
// Check for literal {size}\r\n — reading exact byte count of literal data
|
|
486
486
|
if (this.pendingCommand?.literalBytes != null) {
|
|
487
487
|
if (this.buffer.length >= this.pendingCommand.literalBytes) {
|
|
488
|
-
|
|
488
|
+
let literal = this.buffer.substring(0, this.pendingCommand.literalBytes);
|
|
489
489
|
this.buffer = this.buffer.substring(this.pendingCommand.literalBytes);
|
|
490
|
+
// For non-BODY literals (e.g. display names in ENVELOPE), wrap in quotes
|
|
491
|
+
// so tokenizeParenList treats them as a single token
|
|
492
|
+
if (!this.pendingCommand.currentLiteralKey) {
|
|
493
|
+
literal = `"${literal.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\r?\n/g, "")}"`;
|
|
494
|
+
}
|
|
490
495
|
this.pendingCommand.literalBuffer = (this.pendingCommand.literalBuffer || "") + literal;
|
|
491
496
|
this.pendingCommand.literalBytes = undefined;
|
|
492
497
|
// Store the literal data by its BODY key for parseFetchResponses
|