imapflow 1.0.164 → 1.0.166
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 +47 -61
- package/lib/commands/idle.js +1 -1
- package/lib/commands/login.js +2 -2
- package/lib/handler/imap-compiler.js +1 -1
- package/lib/imap-flow.js +7 -7
- package/lib/tools.js +1 -1
- package/lib/types.d.ts +4 -4
- package/package.json +9 -9
- package/test/imap-parser-test.js +59 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,203 +1,189 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## [1.0.
|
|
3
|
+
## [1.0.166](https://github.com/postalsys/imapflow/compare/v1.0.165...v1.0.166) (2024-11-05)
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
### Bug Fixes
|
|
7
7
|
|
|
8
|
-
* **
|
|
8
|
+
* **login:** Always treat username and password as strings, not atom ([01b3471](https://github.com/postalsys/imapflow/commit/01b347145551c046e4400b8824be9be3c69d353b))
|
|
9
9
|
|
|
10
|
-
## [1.0.
|
|
10
|
+
## [1.0.165](https://github.com/postalsys/imapflow/compare/v1.0.164...v1.0.165) (2024-11-01)
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
### Bug Fixes
|
|
14
14
|
|
|
15
|
-
* **
|
|
16
|
-
* **socket:** Use destroy() instead of destroySoon() ([830c2d1](https://github.com/postalsys/imapflow/commit/830c2d18f3d27eb12dc6babe4edd37fed5f65490))
|
|
15
|
+
* **imap:** Support invalid servers that return a full partial instead of starting byte for a FETCH property ([7281ce9](https://github.com/postalsys/imapflow/commit/7281ce98683946f825b5bfec197beecad7867a70))
|
|
17
16
|
|
|
18
|
-
## [1.0.
|
|
17
|
+
## [1.0.164](https://github.com/postalsys/imapflow/compare/v1.0.163...v1.0.164) (2024-07-09)
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
- **api:** Add fetchAll method ([#207](https://github.com/postalsys/imapflow/issues/207)) ([bc09998](https://github.com/postalsys/imapflow/commit/bc09998270006ea6ff8430b3461619dd9b3e91c8))
|
|
19
22
|
|
|
23
|
+
## [1.0.163](https://github.com/postalsys/imapflow/compare/v1.0.162...v1.0.163) (2024-07-06)
|
|
20
24
|
|
|
21
25
|
### Bug Fixes
|
|
22
26
|
|
|
23
|
-
|
|
27
|
+
- **parser:** parse subfolders with square brackets ([0d0e8a6](https://github.com/postalsys/imapflow/commit/0d0e8a6ea379adf11594684d49a1ce5031339939))
|
|
28
|
+
- **socket:** Use destroy() instead of destroySoon() ([830c2d1](https://github.com/postalsys/imapflow/commit/830c2d18f3d27eb12dc6babe4edd37fed5f65490))
|
|
24
29
|
|
|
25
|
-
## [1.0.
|
|
30
|
+
## [1.0.162](https://github.com/postalsys/imapflow/compare/v1.0.161...v1.0.162) (2024-05-07)
|
|
26
31
|
|
|
32
|
+
### Bug Fixes
|
|
33
|
+
|
|
34
|
+
- **idle:** Do not clear preCheck from other command ([cdf7643](https://github.com/postalsys/imapflow/commit/cdf7643952c975556e11a03ceca85f8a57fe1420))
|
|
35
|
+
|
|
36
|
+
## [1.0.161](https://github.com/postalsys/imapflow/compare/v1.0.160...v1.0.161) (2024-05-06)
|
|
27
37
|
|
|
28
38
|
### Bug Fixes
|
|
29
39
|
|
|
30
|
-
|
|
40
|
+
- **listTree:** pass listing options as an optional argument ([917ba80](https://github.com/postalsys/imapflow/commit/917ba80f21b2fe485154acd252d6565b838e73e6))
|
|
31
41
|
|
|
32
42
|
## [1.0.160](https://github.com/postalsys/imapflow/compare/v1.0.159...v1.0.160) (2024-04-22)
|
|
33
43
|
|
|
34
|
-
|
|
35
44
|
### Bug Fixes
|
|
36
45
|
|
|
37
|
-
|
|
46
|
+
- **copy:** Updated cipyright year to 2024 ([e3f5040](https://github.com/postalsys/imapflow/commit/e3f5040e8f90523e12108e978ac5002f8caa9e1e))
|
|
38
47
|
|
|
39
48
|
## [1.0.159](https://github.com/postalsys/imapflow/compare/v1.0.158...v1.0.159) (2024-04-12)
|
|
40
49
|
|
|
41
|
-
|
|
42
50
|
### Bug Fixes
|
|
43
51
|
|
|
44
|
-
|
|
52
|
+
- **deps:** Bumped deps ([53ccd8b](https://github.com/postalsys/imapflow/commit/53ccd8b1027782dcd2af6dd1f7d337007a7f79c0))
|
|
45
53
|
|
|
46
54
|
## [1.0.158](https://github.com/postalsys/imapflow/compare/v1.0.157...v1.0.158) (2024-03-19)
|
|
47
55
|
|
|
48
|
-
|
|
49
56
|
### Bug Fixes
|
|
50
57
|
|
|
51
|
-
|
|
58
|
+
- **locking:** log extra information about locks ([9790ec5](https://github.com/postalsys/imapflow/commit/9790ec575f405820d05dd4777987a88e0a4e819d))
|
|
52
59
|
|
|
53
60
|
## [1.0.157](https://github.com/postalsys/imapflow/compare/v1.0.156...v1.0.157) (2024-03-19)
|
|
54
61
|
|
|
55
|
-
|
|
56
62
|
### Bug Fixes
|
|
57
63
|
|
|
58
|
-
|
|
64
|
+
- **logs:** Log mailbox lock description ([ce87cf5](https://github.com/postalsys/imapflow/commit/ce87cf5a256ddc324624893a1c17992475fafeb3))
|
|
59
65
|
|
|
60
66
|
## [1.0.156](https://github.com/postalsys/imapflow/compare/v1.0.155...v1.0.156) (2024-03-07)
|
|
61
67
|
|
|
62
|
-
|
|
63
68
|
### Bug Fixes
|
|
64
69
|
|
|
65
|
-
|
|
70
|
+
- micro-optimizations for parser ([3451ad2](https://github.com/postalsys/imapflow/commit/3451ad235532ca1a64a829f9f2f8e77bcef3a17d))
|
|
66
71
|
|
|
67
72
|
## [1.0.155](https://github.com/postalsys/imapflow/compare/v1.0.154...v1.0.155) (2024-03-06)
|
|
68
73
|
|
|
69
|
-
|
|
70
74
|
### Bug Fixes
|
|
71
75
|
|
|
72
|
-
|
|
76
|
+
- **exchange:** handle special error response from exchange ([3ed4198](https://github.com/postalsys/imapflow/commit/3ed4198c1b5504ab0b46926fec179c682988b2e3))
|
|
73
77
|
|
|
74
78
|
## [1.0.154](https://github.com/postalsys/imapflow/compare/v1.0.153...v1.0.154) (2024-03-05)
|
|
75
79
|
|
|
76
|
-
|
|
77
80
|
### Bug Fixes
|
|
78
81
|
|
|
79
|
-
|
|
82
|
+
- **FETCH:** throw on failing FETCH ([12f9a45](https://github.com/postalsys/imapflow/commit/12f9a45530c6f3a2f35ba2968819011eea9c32b2))
|
|
80
83
|
|
|
81
84
|
## [1.0.153](https://github.com/postalsys/imapflow/compare/v1.0.152...v1.0.153) (2024-02-29)
|
|
82
85
|
|
|
83
|
-
|
|
84
86
|
### Bug Fixes
|
|
85
87
|
|
|
86
|
-
|
|
88
|
+
- **deps:** Bumped deps ([559aa72](https://github.com/postalsys/imapflow/commit/559aa72337018f21a3675f4521ce4aae87e0aabb))
|
|
87
89
|
|
|
88
90
|
## [1.0.152](https://github.com/postalsys/imapflow/compare/v1.0.151...v1.0.152) (2024-02-12)
|
|
89
91
|
|
|
90
|
-
|
|
91
92
|
### Bug Fixes
|
|
92
93
|
|
|
93
|
-
|
|
94
|
+
- **address:** do not use '@' instead of empyt address if a field does not contain a value ([aeabbde](https://github.com/postalsys/imapflow/commit/aeabbded3bf3c6ba7266f79d4bc001980644da0d))
|
|
94
95
|
|
|
95
96
|
## [1.0.151](https://github.com/postalsys/imapflow/compare/v1.0.150...v1.0.151) (2024-02-12)
|
|
96
97
|
|
|
97
|
-
|
|
98
98
|
### Bug Fixes
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
- **filename:** Fixed filename decoding for the download method ([68a8159](https://github.com/postalsys/imapflow/commit/68a8159a0988245bf3f7c9b002823b01d9d24876))
|
|
101
101
|
|
|
102
102
|
## [1.0.150](https://github.com/postalsys/imapflow/compare/v1.0.149...v1.0.150) (2024-02-01)
|
|
103
103
|
|
|
104
|
-
|
|
105
104
|
### Bug Fixes
|
|
106
105
|
|
|
107
|
-
|
|
106
|
+
- **deps:** Bumped Nodemailer version ([ee02764](https://github.com/postalsys/imapflow/commit/ee0276493494ecf08be557cc0c486fe309d359bf))
|
|
108
107
|
|
|
109
108
|
## [1.0.149](https://github.com/postalsys/imapflow/compare/v1.0.148...v1.0.149) (2024-01-31)
|
|
110
109
|
|
|
111
|
-
|
|
112
110
|
### Bug Fixes
|
|
113
111
|
|
|
114
|
-
|
|
112
|
+
- **flag-colors:** added a method to set Flag Color. The color is also included in the Fetch response structure ([d840951](https://github.com/postalsys/imapflow/commit/d8409513075b864e9131665af3f1670a0714d05c))
|
|
115
113
|
|
|
116
114
|
## [1.0.148](https://github.com/postalsys/imapflow/compare/v1.0.147...v1.0.148) (2024-01-16)
|
|
117
115
|
|
|
118
|
-
|
|
119
116
|
### Bug Fixes
|
|
120
117
|
|
|
121
|
-
|
|
118
|
+
- **logout:** Fixed race condition for logout and TCP close. Fixes [#161](https://github.com/postalsys/imapflow/issues/161) ([39a7333](https://github.com/postalsys/imapflow/commit/39a7333a39499e4876abb29149f7c72f2f99a63d))
|
|
122
119
|
|
|
123
120
|
## [1.0.147](https://github.com/postalsys/imapflow/compare/v1.0.146...v1.0.147) (2023-10-26)
|
|
124
121
|
|
|
125
|
-
|
|
126
122
|
### Bug Fixes
|
|
127
123
|
|
|
128
|
-
|
|
124
|
+
- **idle:** removed unneeded variable ([da59d9a](https://github.com/postalsys/imapflow/commit/da59d9a960dd0992b22335902808a315b1cb6ded))
|
|
129
125
|
|
|
130
126
|
## [1.0.146](https://github.com/postalsys/imapflow/compare/v1.0.145...v1.0.146) (2023-10-26)
|
|
131
127
|
|
|
132
|
-
|
|
133
128
|
### Bug Fixes
|
|
134
129
|
|
|
135
|
-
|
|
130
|
+
- **throttling:** automatically retry throttled FETCH commands a few times ([07a9aea](https://github.com/postalsys/imapflow/commit/07a9aea37ae55ed885ccc4c0e3732b367ad82cd3))
|
|
136
131
|
|
|
137
132
|
## [1.0.145](https://github.com/postalsys/imapflow/compare/v1.0.144...v1.0.145) (2023-10-26)
|
|
138
133
|
|
|
139
|
-
|
|
140
134
|
### Bug Fixes
|
|
141
135
|
|
|
142
|
-
|
|
143
|
-
|
|
136
|
+
- **docs:** Fixed mailbox property name in AppendResponseObject ([ca6d789](https://github.com/postalsys/imapflow/commit/ca6d789b761d3117f733ed7b026122098f4d9142))
|
|
137
|
+
- **special-use:** support custom special use flags for the Archive folder ([17aa6a8](https://github.com/postalsys/imapflow/commit/17aa6a8baf180a7349fe30f897184eb8e359a498))
|
|
144
138
|
|
|
145
139
|
## [1.0.144](https://github.com/postalsys/imapflow/compare/v1.0.143...v1.0.144) (2023-09-13)
|
|
146
140
|
|
|
147
|
-
|
|
148
141
|
### Bug Fixes
|
|
149
142
|
|
|
150
|
-
|
|
143
|
+
- **MS365:** Wait until responding with a throttling response ([#142](https://github.com/postalsys/imapflow/issues/142)) ([09bfb3e](https://github.com/postalsys/imapflow/commit/09bfb3e1b90bdd37bc1c9b40e9284ad4afbd5c72))
|
|
151
144
|
|
|
152
145
|
## [1.0.143](https://github.com/postalsys/imapflow/compare/v1.0.142...v1.0.143) (2023-09-04)
|
|
153
146
|
|
|
154
|
-
|
|
155
147
|
### Bug Fixes
|
|
156
148
|
|
|
157
|
-
|
|
149
|
+
- **release:** updated provenance setting ([e178629](https://github.com/postalsys/imapflow/commit/e1786296569e5a0acfb997b007091925519c7d79))
|
|
158
150
|
|
|
159
151
|
## [1.0.142](https://github.com/postalsys/imapflow/compare/v1.0.141...v1.0.142) (2023-09-04)
|
|
160
152
|
|
|
161
|
-
|
|
162
153
|
### Bug Fixes
|
|
163
154
|
|
|
164
|
-
|
|
155
|
+
- **release:** updated provenance setting ([4fd5fa8](https://github.com/postalsys/imapflow/commit/4fd5fa8aa74756c1b9ff166febf294acda4792b8))
|
|
165
156
|
|
|
166
157
|
## [1.0.141](https://github.com/postalsys/imapflow/compare/v1.0.140...v1.0.141) (2023-09-04)
|
|
167
158
|
|
|
168
|
-
|
|
169
159
|
### Bug Fixes
|
|
170
160
|
|
|
171
|
-
|
|
161
|
+
- **readme:** testing note format ([3038c4d](https://github.com/postalsys/imapflow/commit/3038c4d9740af0a5161bbc45dd13b86d4febc0ac))
|
|
172
162
|
|
|
173
163
|
## [1.0.140](https://github.com/postalsys/imapflow/compare/v1.0.139...v1.0.140) (2023-09-04)
|
|
174
164
|
|
|
175
|
-
|
|
176
165
|
### Bug Fixes
|
|
177
166
|
|
|
178
|
-
|
|
167
|
+
- **license:** bumped license timeframe in README ([9a04730](https://github.com/postalsys/imapflow/commit/9a047309d10c0ef056c53fba3493df9f2fea5a1d))
|
|
179
168
|
|
|
180
169
|
## [1.0.139](https://github.com/postalsys/imapflow/compare/v1.0.138...v1.0.139) (2023-09-04)
|
|
181
170
|
|
|
182
|
-
|
|
183
171
|
### Bug Fixes
|
|
184
172
|
|
|
185
|
-
|
|
173
|
+
- **license:** Bumped license timeframe ([ce308b6](https://github.com/postalsys/imapflow/commit/ce308b66e5d30819c6bab7d75752528abc4b8436))
|
|
186
174
|
|
|
187
175
|
## [1.0.138](https://github.com/postalsys/imapflow/compare/v1.0.137...v1.0.138) (2023-09-04)
|
|
188
176
|
|
|
189
|
-
|
|
190
177
|
### Bug Fixes
|
|
191
178
|
|
|
192
|
-
|
|
193
|
-
|
|
179
|
+
- **release:** Added package-lock ([e35bda8](https://github.com/postalsys/imapflow/commit/e35bda8a2b14503ba30a46b555df82ab1084cf5a))
|
|
180
|
+
- **release:** updated package-lock ([b59220f](https://github.com/postalsys/imapflow/commit/b59220f54a58111e0b3259c502ff51b2a624f397))
|
|
194
181
|
|
|
195
182
|
## [1.0.137](https://github.com/postalsys/imapflow/compare/v1.0.136...v1.0.137) (2023-09-04)
|
|
196
183
|
|
|
197
|
-
|
|
198
184
|
### Bug Fixes
|
|
199
185
|
|
|
200
|
-
|
|
186
|
+
- **deps:** Bumped dependencies ([e8f5e8c](https://github.com/postalsys/imapflow/commit/e8f5e8ce431debddeecf523fa8739ae5ad23c659))
|
|
201
187
|
|
|
202
188
|
## CHANGELOG
|
|
203
189
|
|
|
@@ -247,7 +233,7 @@
|
|
|
247
233
|
|
|
248
234
|
- 1.0.112 - 2022-10-16
|
|
249
235
|
|
|
250
|
-
- Improved ID
|
|
236
|
+
- Improved ID compatibility with servers that allow ID only after login
|
|
251
237
|
|
|
252
238
|
- 1.0.111 - 2022-10-13
|
|
253
239
|
|
|
@@ -455,7 +441,7 @@
|
|
|
455
441
|
|
|
456
442
|
- 1.0.42 - 2020-04-13
|
|
457
443
|
|
|
458
|
-
- Try to
|
|
444
|
+
- Try to handle edge case when authenticating against Exchange IMAP
|
|
459
445
|
|
|
460
446
|
- 1.0.41 - 2020-04-12
|
|
461
447
|
|
package/lib/commands/idle.js
CHANGED
|
@@ -105,7 +105,7 @@ async function runIdle(connection) {
|
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
//
|
|
108
|
+
// Listens for changes in mailbox
|
|
109
109
|
module.exports = async (connection, maxIdleTime) => {
|
|
110
110
|
if (connection.state !== connection.states.SELECTED) {
|
|
111
111
|
// nothing to do here
|
package/lib/commands/login.js
CHANGED
|
@@ -11,8 +11,8 @@ module.exports = async (connection, username, password) => {
|
|
|
11
11
|
|
|
12
12
|
try {
|
|
13
13
|
let response = await connection.exec('LOGIN', [
|
|
14
|
-
{ type: '
|
|
15
|
-
{ type: '
|
|
14
|
+
{ type: 'STRING', value: username },
|
|
15
|
+
{ type: 'STRING', value: password, sensitive: true }
|
|
16
16
|
]);
|
|
17
17
|
response.next();
|
|
18
18
|
|
|
@@ -61,7 +61,7 @@ module.exports = async (response, options) => {
|
|
|
61
61
|
lastType = 'LIST';
|
|
62
62
|
resp.push(formatRespEntry('('));
|
|
63
63
|
|
|
64
|
-
// check if we need to skip
|
|
64
|
+
// check if we need to skip separator WS between two arrays
|
|
65
65
|
let subArray = node.length > 1 && Array.isArray(node[0]);
|
|
66
66
|
|
|
67
67
|
for (let child of node) {
|
package/lib/imap-flow.js
CHANGED
|
@@ -1330,7 +1330,7 @@ class ImapFlow extends EventEmitter {
|
|
|
1330
1330
|
|
|
1331
1331
|
this.greetingTimeout = setTimeout(() => {
|
|
1332
1332
|
let err = new Error(`Failed to receive greeting from server in required time${!this.secureConnection ? '. Maybe should use TLS?' : ''}`);
|
|
1333
|
-
err.code = '
|
|
1333
|
+
err.code = 'GREETING_TIMEOUT';
|
|
1334
1334
|
err.details = {
|
|
1335
1335
|
greetingTimeout: this.options.greetingTimeout || GREETING_TIMEOUT
|
|
1336
1336
|
};
|
|
@@ -1371,7 +1371,7 @@ class ImapFlow extends EventEmitter {
|
|
|
1371
1371
|
};
|
|
1372
1372
|
|
|
1373
1373
|
if (socket) {
|
|
1374
|
-
// socket is already
|
|
1374
|
+
// socket is already established via proxy
|
|
1375
1375
|
if (this.secureConnection) {
|
|
1376
1376
|
// TLS socket requires a handshake
|
|
1377
1377
|
opts.socket = socket;
|
|
@@ -1841,7 +1841,7 @@ class ImapFlow extends EventEmitter {
|
|
|
1841
1841
|
* @property {Date|string} [sentSince] Matches messages sent after date
|
|
1842
1842
|
* @property {String} [keyword] Matches messages that have the custom flag set
|
|
1843
1843
|
* @property {String} [unKeyword] Matches messages that do not have the custom flag set
|
|
1844
|
-
* @property {Object.<string, Boolean|String>} [header]
|
|
1844
|
+
* @property {Object.<string, Boolean|String>} [header] Matches messages with header key set if value is `true` (**NB!** not supported by all servers) or messages where header partially matches a string value
|
|
1845
1845
|
* @property {SearchObject[]} [or] An array of 2 or more {@link SearchObject} objects. At least on of these must match
|
|
1846
1846
|
*/
|
|
1847
1847
|
|
|
@@ -2213,7 +2213,7 @@ class ImapFlow extends EventEmitter {
|
|
|
2213
2213
|
* @property {Number} [size] Expected size of the node
|
|
2214
2214
|
* @property {MessageEnvelopeObject} [envelope] message envelope of embedded RFC822 message
|
|
2215
2215
|
* @property {String} [disposition] Content disposition
|
|
2216
|
-
* @property {Object} [dispositionParameters] Additional parameters for
|
|
2216
|
+
* @property {Object} [dispositionParameters] Additional parameters for Content-Disposition
|
|
2217
2217
|
* @property {MessageStructureObject[]} childNodes An array of child nodes if this is a multipart node. Not present for normal nodes
|
|
2218
2218
|
*/
|
|
2219
2219
|
|
|
@@ -2428,14 +2428,14 @@ class ImapFlow extends EventEmitter {
|
|
|
2428
2428
|
* @property {Object} meta content metadata
|
|
2429
2429
|
* @property {number} meta.expectedSize The fetch response size
|
|
2430
2430
|
* @property {String} meta.contentType Content-Type of the streamed file. If part was not set then this value is "message/rfc822"
|
|
2431
|
-
* @property {String} [meta.charset] Charset of the body part. Text parts are
|
|
2431
|
+
* @property {String} [meta.charset] Charset of the body part. Text parts are automatically converted to UTF-8, attachments are kept as is
|
|
2432
2432
|
* @property {String} [meta.disposition] Content-Disposition of the streamed file
|
|
2433
2433
|
* @property {String} [meta.filename] Filename of the streamed body part
|
|
2434
2434
|
* @property {ReadableStream} content Streamed content
|
|
2435
2435
|
*/
|
|
2436
2436
|
|
|
2437
2437
|
/**
|
|
2438
|
-
* Download either full rfc822
|
|
2438
|
+
* Download either full rfc822 formatted message or a specific bodystructure part as a Stream.
|
|
2439
2439
|
* Bodystructure parts are decoded so the resulting stream is a binary file. Text content
|
|
2440
2440
|
* is automatically converted to UTF-8 charset.
|
|
2441
2441
|
*
|
|
@@ -3093,7 +3093,7 @@ class ImapFlow extends EventEmitter {
|
|
|
3093
3093
|
}
|
|
3094
3094
|
|
|
3095
3095
|
/**
|
|
3096
|
-
* Connection close event. **NB!** ImapFlow does not handle
|
|
3096
|
+
* Connection close event. **NB!** ImapFlow does not handle reconnects automatically.
|
|
3097
3097
|
* So whenever a 'close' event occurs you must create a new connection yourself.
|
|
3098
3098
|
*
|
|
3099
3099
|
* @event module:imapflow~ImapFlow#close
|
package/lib/tools.js
CHANGED
package/lib/types.d.ts
CHANGED
|
@@ -494,7 +494,7 @@ declare module "imapflow" {
|
|
|
494
494
|
binary?: boolean;
|
|
495
495
|
}): Promise<FetchMessageObject>;
|
|
496
496
|
/**
|
|
497
|
-
* Download either full rfc822
|
|
497
|
+
* Download either full rfc822 formatted message or a specific bodystructure part as a Stream.
|
|
498
498
|
* Bodystructure parts are decoded so the resulting stream is a binary file. Text content
|
|
499
499
|
* is automatically converted to UTF-8 charset.
|
|
500
500
|
* @example
|
|
@@ -812,7 +812,7 @@ declare type SequenceString = string;
|
|
|
812
812
|
* @property [sentSince] - Matches messages sent after date
|
|
813
813
|
* @property [keyword] - Matches messages that have the custom flag set
|
|
814
814
|
* @property [unKeyword] - Matches messages that do not have the custom flag set
|
|
815
|
-
* @property [header] -
|
|
815
|
+
* @property [header] - Matches messages with header key set if value is `true` (**NB!** not supported by all servers) or messages where header partially matches a string value
|
|
816
816
|
* @property [or] - An array of 2 or more {@link SearchObject} objects. At least on of these must match
|
|
817
817
|
*/
|
|
818
818
|
declare type SearchObject = {
|
|
@@ -956,7 +956,7 @@ declare type MessageEnvelopeObject = {
|
|
|
956
956
|
* @property [size] - Expected size of the node
|
|
957
957
|
* @property [envelope] - message envelope of embedded RFC822 message
|
|
958
958
|
* @property [disposition] - Content disposition
|
|
959
|
-
* @property [dispositionParameters] - Additional parameters for
|
|
959
|
+
* @property [dispositionParameters] - Additional parameters for Content-Disposition
|
|
960
960
|
* @property childNodes - An array of child nodes if this is a multipart node. Not present for normal nodes
|
|
961
961
|
*/
|
|
962
962
|
declare type MessageStructureObject = {
|
|
@@ -1012,7 +1012,7 @@ declare type FetchMessageObject = {
|
|
|
1012
1012
|
* @property meta - content metadata
|
|
1013
1013
|
* @property meta.expectedSize - The fetch response size
|
|
1014
1014
|
* @property meta.contentType - Content-Type of the streamed file. If part was not set then this value is "message/rfc822"
|
|
1015
|
-
* @property [meta.charset] - Charset of the body part. Text parts are
|
|
1015
|
+
* @property [meta.charset] - Charset of the body part. Text parts are automatically converted to UTF-8, attachments are kept as is
|
|
1016
1016
|
* @property [meta.disposition] - Content-Disposition of the streamed file
|
|
1017
1017
|
* @property [meta.filename] - Filename of the streamed body part
|
|
1018
1018
|
* @property content - Streamed content
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "imapflow",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.166",
|
|
4
4
|
"description": "IMAP Client for Node",
|
|
5
5
|
"main": "./lib/imap-flow.js",
|
|
6
6
|
"scripts": {
|
|
@@ -28,21 +28,21 @@
|
|
|
28
28
|
},
|
|
29
29
|
"homepage": "https://imapflow.com/",
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@babel/eslint-parser": "7.
|
|
32
|
-
"@babel/eslint-plugin": "7.
|
|
31
|
+
"@babel/eslint-parser": "7.25.9",
|
|
32
|
+
"@babel/eslint-plugin": "7.25.9",
|
|
33
33
|
"@babel/plugin-syntax-class-properties": "7.12.13",
|
|
34
|
-
"@babel/preset-env": "7.
|
|
35
|
-
"@types/node": "
|
|
34
|
+
"@babel/preset-env": "7.26.0",
|
|
35
|
+
"@types/node": "22.9.0",
|
|
36
36
|
"eslint": "8.57.0",
|
|
37
37
|
"eslint-config-nodemailer": "1.2.0",
|
|
38
38
|
"eslint-config-prettier": "9.1.0",
|
|
39
39
|
"grunt": "1.6.1",
|
|
40
|
-
"grunt-cli": "1.
|
|
40
|
+
"grunt-cli": "1.5.0",
|
|
41
41
|
"grunt-contrib-nodeunit": "5.0.0",
|
|
42
42
|
"grunt-eslint": "24.3.0",
|
|
43
43
|
"imapflow-jsdoc-template": "3.4.0-imapflow.1",
|
|
44
44
|
"jsdoc": "3.6.11",
|
|
45
|
-
"st": "3.0.
|
|
45
|
+
"st": "3.0.1",
|
|
46
46
|
"tsd-jsdoc": "2.5.0"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"libmime": "5.3.5",
|
|
53
53
|
"libqp": "2.1.0",
|
|
54
54
|
"mailsplit": "5.4.0",
|
|
55
|
-
"nodemailer": "6.9.
|
|
56
|
-
"pino": "9.
|
|
55
|
+
"nodemailer": "6.9.16",
|
|
56
|
+
"pino": "9.5.0",
|
|
57
57
|
"socks": "2.8.3"
|
|
58
58
|
}
|
|
59
59
|
}
|
package/test/imap-parser-test.js
CHANGED
|
@@ -1002,3 +1002,62 @@ module.exports['IMAP Parser, subfolder square bracket'] = test =>
|
|
|
1002
1002
|
{ type: 'ATOM', value: 'INBOX.[Airmail].Snooze' }
|
|
1003
1003
|
]);
|
|
1004
1004
|
});
|
|
1005
|
+
|
|
1006
|
+
module.exports['IMAP Parser, FETCH with full range'] = test =>
|
|
1007
|
+
asyncWrapper(test, async test => {
|
|
1008
|
+
let parsed = await parser('* 32 FETCH (UID 32 RFC822.SIZE 3991 BODY[2.MIME] "(* 61B literal *)" BODY[2]<0.65536> "(* 6B literal *)")');
|
|
1009
|
+
console.log(JSON.stringify(parsed.attributes));
|
|
1010
|
+
test.deepEqual(parsed.attributes, [
|
|
1011
|
+
{
|
|
1012
|
+
type: 'ATOM',
|
|
1013
|
+
value: 'FETCH'
|
|
1014
|
+
},
|
|
1015
|
+
[
|
|
1016
|
+
{
|
|
1017
|
+
type: 'ATOM',
|
|
1018
|
+
value: 'UID'
|
|
1019
|
+
},
|
|
1020
|
+
{
|
|
1021
|
+
type: 'ATOM',
|
|
1022
|
+
value: '32'
|
|
1023
|
+
},
|
|
1024
|
+
{
|
|
1025
|
+
type: 'ATOM',
|
|
1026
|
+
value: 'RFC822.SIZE'
|
|
1027
|
+
},
|
|
1028
|
+
{
|
|
1029
|
+
type: 'ATOM',
|
|
1030
|
+
value: '3991'
|
|
1031
|
+
},
|
|
1032
|
+
{
|
|
1033
|
+
type: 'ATOM',
|
|
1034
|
+
value: 'BODY',
|
|
1035
|
+
section: [
|
|
1036
|
+
{
|
|
1037
|
+
type: 'ATOM',
|
|
1038
|
+
value: '2.MIME'
|
|
1039
|
+
}
|
|
1040
|
+
]
|
|
1041
|
+
},
|
|
1042
|
+
{
|
|
1043
|
+
type: 'STRING',
|
|
1044
|
+
value: '(* 61B literal *)'
|
|
1045
|
+
},
|
|
1046
|
+
{
|
|
1047
|
+
type: 'ATOM',
|
|
1048
|
+
value: 'BODY',
|
|
1049
|
+
section: [
|
|
1050
|
+
{
|
|
1051
|
+
type: 'ATOM',
|
|
1052
|
+
value: '2'
|
|
1053
|
+
}
|
|
1054
|
+
],
|
|
1055
|
+
partial: [0, 65536]
|
|
1056
|
+
},
|
|
1057
|
+
{
|
|
1058
|
+
type: 'STRING',
|
|
1059
|
+
value: '(* 6B literal *)'
|
|
1060
|
+
}
|
|
1061
|
+
]
|
|
1062
|
+
]);
|
|
1063
|
+
});
|