imapflow 1.0.188 → 1.0.189

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,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.0.189](https://github.com/postalsys/imapflow/compare/v1.0.188...v1.0.189) (2025-06-30)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * improved error handling ([0b955e4](https://github.com/postalsys/imapflow/commit/0b955e4e4a4ce05cae61ae603b68b84f3e19539c))
9
+ * Remove diacritics in ID values ([c79df56](https://github.com/postalsys/imapflow/commit/c79df5619f3cc6db36d3657a4746a112d2f33b15))
10
+
3
11
  ## [1.0.188](https://github.com/postalsys/imapflow/compare/v1.0.187...v1.0.188) (2025-06-13)
4
12
 
5
13
 
@@ -11,14 +11,19 @@ module.exports = async (command, options) => {
11
11
  // special case with a buggy IMAP server where responses are padded with zero bytes
12
12
  if (command[0] === 0) {
13
13
  // find the first non null byte and trim
14
+ let firstNonNull = -1;
14
15
  for (let i = 0; i < command.length; i++) {
15
16
  if (command[i] !== 0) {
16
- // trim to here
17
- command = command.slice(i);
18
- nullBytesRemoved = i;
17
+ firstNonNull = i;
19
18
  break;
20
19
  }
21
20
  }
21
+ if (firstNonNull === -1) {
22
+ // All bytes are null
23
+ return { tag: '*', command: 'BAD', attributes: [] };
24
+ }
25
+ command = command.slice(firstNonNull);
26
+ nullBytesRemoved = firstNonNull;
22
27
  }
23
28
 
24
29
  const parser = new ParserInstance(command, options);