imapflow 1.0.86 → 1.0.89
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 +12 -0
- package/lib/commands/list.js +2 -2
- package/lib/imap-flow.js +14 -0
- package/lib/tools.js +3 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
- 1.0.89 - 2022-04-04
|
|
4
|
+
|
|
5
|
+
- Added new event type `response` that emits all command responses
|
|
6
|
+
|
|
7
|
+
- 1.0.88 - 2022-03-24
|
|
8
|
+
|
|
9
|
+
- Fixed folder name match where not all non-ascii characters triggered UTF encoding
|
|
10
|
+
|
|
11
|
+
- 1.0.87 - 2022-03-21
|
|
12
|
+
|
|
13
|
+
- If LIST failed then do not suppress exception
|
|
14
|
+
|
|
3
15
|
- 1.0.86 - 2022-03-14
|
|
4
16
|
|
|
5
17
|
- Do not try to decode mailbox path from utf7 as methods expect utf-8 not utf-7
|
package/lib/commands/list.js
CHANGED
|
@@ -156,7 +156,7 @@ module.exports = async (connection, reference, mailbox) => {
|
|
|
156
156
|
|
|
157
157
|
return entries;
|
|
158
158
|
} catch (err) {
|
|
159
|
-
connection.log.warn({ err, cid: connection.id });
|
|
160
|
-
|
|
159
|
+
connection.log.warn({ msg: 'Failed to list folders', err, cid: connection.id });
|
|
160
|
+
throw err;
|
|
161
161
|
}
|
|
162
162
|
};
|
package/lib/imap-flow.js
CHANGED
|
@@ -411,6 +411,20 @@ class ImapFlow extends EventEmitter {
|
|
|
411
411
|
|
|
412
412
|
try {
|
|
413
413
|
parsed = await parser(data.payload, { literals: data.literals });
|
|
414
|
+
if (parsed.tag && !['*', '+'].includes(parsed.tag) && parsed.command) {
|
|
415
|
+
let payload = { response: parsed.command };
|
|
416
|
+
|
|
417
|
+
if (
|
|
418
|
+
parsed.attributes &&
|
|
419
|
+
parsed.attributes[0] &&
|
|
420
|
+
parsed.attributes[0].section &&
|
|
421
|
+
parsed.attributes[0].section[0] &&
|
|
422
|
+
parsed.attributes[0].section[0].type === 'ATOM'
|
|
423
|
+
) {
|
|
424
|
+
payload.code = parsed.attributes[0].section[0].value;
|
|
425
|
+
}
|
|
426
|
+
this.emit('response', payload);
|
|
427
|
+
}
|
|
414
428
|
} catch (err) {
|
|
415
429
|
// can not make sense of this
|
|
416
430
|
this.log.error({ src: 's', msg: data.payload.toString(), err, cid: this.id });
|
package/lib/tools.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint no-control-regex:0 */
|
|
2
|
+
|
|
1
3
|
'use strict';
|
|
2
4
|
|
|
3
5
|
const libmime = require('libmime');
|
|
@@ -17,7 +19,7 @@ module.exports = {
|
|
|
17
19
|
return 'INBOX';
|
|
18
20
|
}
|
|
19
21
|
|
|
20
|
-
if (!connection.enabled.has('UTF8=ACCEPT') && /[\
|
|
22
|
+
if (!connection.enabled.has('UTF8=ACCEPT') && /[\x00-\x08\x0b-\x0c\x0e-\x1f\u0080-\uffff]/.test(path)) {
|
|
21
23
|
try {
|
|
22
24
|
path = iconv.encode(path, 'utf-7-imap').toString();
|
|
23
25
|
} catch (err) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "imapflow",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.89",
|
|
4
4
|
"description": "IMAP Client for Node",
|
|
5
5
|
"main": "./lib/imap-flow.js",
|
|
6
6
|
"scripts": {
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
"@babel/eslint-plugin": "7.17.7",
|
|
31
31
|
"@babel/plugin-syntax-class-properties": "7.12.13",
|
|
32
32
|
"@babel/preset-env": "7.16.11",
|
|
33
|
-
"@types/node": "17.0.
|
|
33
|
+
"@types/node": "17.0.23",
|
|
34
34
|
"braintree-jsdoc-template": "3.3.0",
|
|
35
|
-
"eslint": "8.
|
|
35
|
+
"eslint": "8.12.0",
|
|
36
36
|
"eslint-config-nodemailer": "1.2.0",
|
|
37
37
|
"eslint-config-prettier": "8.5.0",
|
|
38
38
|
"grunt": "1.4.1",
|
|
@@ -43,14 +43,14 @@
|
|
|
43
43
|
"tsd-jsdoc": "2.5.0"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"encoding-japanese": "
|
|
46
|
+
"encoding-japanese": "2.0.0",
|
|
47
47
|
"iconv-lite": "0.6.3",
|
|
48
48
|
"libbase64": "1.2.1",
|
|
49
49
|
"libmime": "5.0.0",
|
|
50
50
|
"libqp": "1.1.0",
|
|
51
51
|
"mailsplit": "5.3.1",
|
|
52
|
-
"nodemailer": "6.7.
|
|
53
|
-
"pino": "7.
|
|
52
|
+
"nodemailer": "6.7.3",
|
|
53
|
+
"pino": "7.9.2",
|
|
54
54
|
"socks": "2.6.2"
|
|
55
55
|
}
|
|
56
56
|
}
|