@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.
@@ -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
- const literal = this.buffer.substring(0, this.pendingCommand.literalBytes);
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/iflow",
3
- "version": "1.0.48",
3
+ "version": "1.0.49",
4
4
  "description": "IMAP client wrapper library",
5
5
  "main": "index.js",
6
6
  "types": "index.ts",