imapflow 1.3.3 → 1.3.4
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/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +8 -0
- package/lib/tools.js +4 -0
- package/package.json +6 -6
- package/test/tools-test.js +27 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.3.4](https://github.com/postalsys/imapflow/compare/v1.3.3...v1.3.4) (2026-05-29)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* bumped deps ([593b805](https://github.com/postalsys/imapflow/commit/593b805ed88d62bf7200a1a2ef081ce49f9162c0))
|
|
9
|
+
* handle THREADID NIL in FETCH response ([#353](https://github.com/postalsys/imapflow/issues/353)) ([40318d6](https://github.com/postalsys/imapflow/commit/40318d69b866989d6e84f1d0652d118920a3162e))
|
|
10
|
+
|
|
3
11
|
## [1.3.3](https://github.com/postalsys/imapflow/compare/v1.3.2...v1.3.3) (2026-04-29)
|
|
4
12
|
|
|
5
13
|
|
package/lib/tools.js
CHANGED
|
@@ -383,6 +383,10 @@ const tools = {
|
|
|
383
383
|
if (Array.isArray(attribute)) {
|
|
384
384
|
return attribute.map(entry => (entry && typeof entry.value === 'string' ? entry.value : false)).filter(entry => entry);
|
|
385
385
|
}
|
|
386
|
+
// NIL (parsed as null) and other non-array values yield an empty array,
|
|
387
|
+
// so callers can safely index into the result. RFC 8474 allows e.g.
|
|
388
|
+
// `THREADID NIL` when the server has no thread relation to report.
|
|
389
|
+
return [];
|
|
386
390
|
};
|
|
387
391
|
|
|
388
392
|
switch (key) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "imapflow",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.4",
|
|
4
4
|
"description": "IMAP Client for Node",
|
|
5
5
|
"main": "lib/imap-flow.js",
|
|
6
6
|
"types": "lib/imap-flow.d.ts",
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
"homepage": "https://imapflow.com/",
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@eslint/js": "10.0.1",
|
|
31
|
-
"@types/node": "25.
|
|
31
|
+
"@types/node": "25.9.1",
|
|
32
32
|
"c8": "11.0.0",
|
|
33
|
-
"eslint": "10.
|
|
33
|
+
"eslint": "10.4.0",
|
|
34
34
|
"eslint-config-nodemailer": "1.2.0",
|
|
35
35
|
"eslint-config-prettier": "10.1.8",
|
|
36
36
|
"grunt": "1.6.2",
|
|
@@ -42,14 +42,14 @@
|
|
|
42
42
|
"typescript": "6.0.3"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@zone-eu/mailsplit": "5.4.
|
|
45
|
+
"@zone-eu/mailsplit": "5.4.12",
|
|
46
46
|
"encoding-japanese": "2.2.0",
|
|
47
47
|
"iconv-lite": "0.7.2",
|
|
48
48
|
"libbase64": "1.3.0",
|
|
49
49
|
"libmime": "5.3.8",
|
|
50
50
|
"libqp": "2.1.1",
|
|
51
|
-
"nodemailer": "8.0.
|
|
51
|
+
"nodemailer": "8.0.10",
|
|
52
52
|
"pino": "10.3.1",
|
|
53
|
-
"socks": "2.8.
|
|
53
|
+
"socks": "2.8.9"
|
|
54
54
|
}
|
|
55
55
|
}
|
package/test/tools-test.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const tools = require('../lib/tools');
|
|
4
|
+
const { parser } = require('../lib/handler/imap-handler');
|
|
4
5
|
|
|
5
6
|
// Mock connection for testing
|
|
6
7
|
let createMockConnection = (options = {}) => ({
|
|
@@ -1137,3 +1138,29 @@ module.exports['Tools: getColorFlags with null returns result not null'] = test
|
|
|
1137
1138
|
test.ok(result.remove.includes('\\Flagged'));
|
|
1138
1139
|
test.done();
|
|
1139
1140
|
};
|
|
1141
|
+
|
|
1142
|
+
// ============================================
|
|
1143
|
+
// formatMessageResponse: OBJECTID NIL handling (RFC 8474)
|
|
1144
|
+
// ============================================
|
|
1145
|
+
|
|
1146
|
+
module.exports['Tools: formatMessageResponse handles THREADID NIL'] = async test => {
|
|
1147
|
+
// RFC 8474 allows `THREADID NIL` when the server has no thread relation to
|
|
1148
|
+
// report (e.g. Strato). The NIL token is parsed as null and must not crash.
|
|
1149
|
+
let untagged = await parser('* 1 FETCH (UID 1 EMAILID (E1) THREADID NIL FLAGS (\\Seen) MODSEQ (4312))');
|
|
1150
|
+
let result = await tools.formatMessageResponse(untagged, {});
|
|
1151
|
+
test.equal(result.seq, 1);
|
|
1152
|
+
test.equal(result.uid, 1);
|
|
1153
|
+
test.equal(result.emailId, 'E1');
|
|
1154
|
+
test.equal(result.threadId, undefined);
|
|
1155
|
+
test.ok(result.flags.has('\\Seen'));
|
|
1156
|
+
test.equal(result.modseq, 4312n);
|
|
1157
|
+
test.done();
|
|
1158
|
+
};
|
|
1159
|
+
|
|
1160
|
+
module.exports['Tools: formatMessageResponse handles normal THREADID'] = async test => {
|
|
1161
|
+
let untagged = await parser('* 2 FETCH (THREADID (T9999) EMAILID (E2))');
|
|
1162
|
+
let result = await tools.formatMessageResponse(untagged, {});
|
|
1163
|
+
test.equal(result.threadId, 'T9999');
|
|
1164
|
+
test.equal(result.emailId, 'E2');
|
|
1165
|
+
test.done();
|
|
1166
|
+
};
|