imapflow 2.0.6 → 2.0.7

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.0.7](https://github.com/postalsys/imapflow/compare/v2.0.6...v2.0.7) (2026-09-25)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **fetch:** keep body sections a server sends as quoted strings ([a4f2f18](https://github.com/postalsys/imapflow/commit/a4f2f181f978dea9e6c94195c1f4ddbe54d52fc7)), closes [#403](https://github.com/postalsys/imapflow/issues/403)
9
+
3
10
  ## [2.0.6](https://github.com/postalsys/imapflow/compare/v2.0.5...v2.0.6) (2026-09-22)
4
11
 
5
12
 
@@ -1,3 +1,3 @@
1
1
  export declare const name = "imapflow";
2
- export declare const version = "2.0.6";
2
+ export declare const version = "2.0.7";
3
3
  export declare const homepage = "https://imapflow.com/";
@@ -3,5 +3,5 @@
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.homepage = exports.version = exports.name = void 0;
5
5
  exports.name = 'imapflow';
6
- exports.version = '2.0.6';
6
+ exports.version = '2.0.7';
7
7
  exports.homepage = 'https://imapflow.com/';
package/dist/cjs/tools.js CHANGED
@@ -681,6 +681,12 @@ async function formatMessageResponse(untagged, mailbox) {
681
681
  if (Buffer.isBuffer(attribute.value)) {
682
682
  return attribute.value;
683
683
  }
684
+ // A section is an nstring, so a server may answer with a quoted string
685
+ // instead of a literal (Yahoo does for small parts). The tokenizer decoded
686
+ // the line as UTF-8, so encoding the same way restores the bytes it sent.
687
+ if (typeof attribute.value === 'string') {
688
+ return Buffer.from(attribute.value);
689
+ }
684
690
  };
685
691
  // NIL (parsed as null) and other non-array values yield an empty array, so callers
686
692
  // can safely index into the result. RFC 8474 allows e.g. `THREADID NIL` when the
@@ -1,3 +1,3 @@
1
1
  export declare const name = "imapflow";
2
- export declare const version = "2.0.6";
2
+ export declare const version = "2.0.7";
3
3
  export declare const homepage = "https://imapflow.com/";
@@ -1,4 +1,4 @@
1
1
  // Generated by scripts/build.js from package.json. Do not edit by hand.
2
2
  export const name = 'imapflow';
3
- export const version = '2.0.6';
3
+ export const version = '2.0.7';
4
4
  export const homepage = 'https://imapflow.com/';
package/dist/esm/tools.js CHANGED
@@ -631,6 +631,12 @@ export async function formatMessageResponse(untagged, mailbox) {
631
631
  if (Buffer.isBuffer(attribute.value)) {
632
632
  return attribute.value;
633
633
  }
634
+ // A section is an nstring, so a server may answer with a quoted string
635
+ // instead of a literal (Yahoo does for small parts). The tokenizer decoded
636
+ // the line as UTF-8, so encoding the same way restores the bytes it sent.
637
+ if (typeof attribute.value === 'string') {
638
+ return Buffer.from(attribute.value);
639
+ }
634
640
  };
635
641
  // NIL (parsed as null) and other non-array values yield an empty array, so callers
636
642
  // can safely index into the result. RFC 8474 allows e.g. `THREADID NIL` when the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imapflow",
3
- "version": "2.0.6",
3
+ "version": "2.0.7",
4
4
  "description": "IMAP Client for Node",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/imap-flow.js",