imapflow 1.0.112 → 1.0.114
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/.ncurc.js +4 -0
- package/CHANGELOG.md +4 -0
- package/lib/handler/imap-stream.js +8 -0
- package/lib/imap-flow.js +23 -2
- package/package.json +6 -6
package/.ncurc.js
ADDED
package/CHANGELOG.md
CHANGED
|
@@ -32,6 +32,8 @@ class ImapStream extends Transform {
|
|
|
32
32
|
cid: this.cid
|
|
33
33
|
});
|
|
34
34
|
|
|
35
|
+
this.readBytesCounter = 0;
|
|
36
|
+
|
|
35
37
|
this.state = LINE;
|
|
36
38
|
this.literalWaiting = 0;
|
|
37
39
|
this.inputBuffer = []; // lines
|
|
@@ -197,6 +199,12 @@ class ImapStream extends Transform {
|
|
|
197
199
|
chunk = Buffer.from(chunk, encoding);
|
|
198
200
|
}
|
|
199
201
|
|
|
202
|
+
if (!chunk || !chunk.length) {
|
|
203
|
+
return next();
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
this.readBytesCounter += chunk.length;
|
|
207
|
+
|
|
200
208
|
if (this.options.logRaw) {
|
|
201
209
|
this.log.trace({
|
|
202
210
|
src: 's',
|
package/lib/imap-flow.js
CHANGED
|
@@ -207,6 +207,8 @@ class ImapFlow extends EventEmitter {
|
|
|
207
207
|
this.requestQueue = [];
|
|
208
208
|
this.currentRequest = false;
|
|
209
209
|
|
|
210
|
+
this.writeBytesCounter = 0;
|
|
211
|
+
|
|
210
212
|
this.commandParts = [];
|
|
211
213
|
|
|
212
214
|
/**
|
|
@@ -331,9 +333,27 @@ class ImapFlow extends EventEmitter {
|
|
|
331
333
|
});
|
|
332
334
|
}
|
|
333
335
|
|
|
336
|
+
this.writeBytesCounter += chunk.length;
|
|
337
|
+
|
|
334
338
|
this.writeSocket.write(chunk);
|
|
335
339
|
}
|
|
336
340
|
|
|
341
|
+
stats(reset) {
|
|
342
|
+
let result = {
|
|
343
|
+
sent: this.writeBytesCounter || 0,
|
|
344
|
+
received: (this.streamer && this.streamer.readBytesCounter) || 0
|
|
345
|
+
};
|
|
346
|
+
|
|
347
|
+
if (reset) {
|
|
348
|
+
this.writeBytesCounter = 0;
|
|
349
|
+
if (this.streamer) {
|
|
350
|
+
this.streamer.readBytesCounter = 0;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
return result;
|
|
355
|
+
}
|
|
356
|
+
|
|
337
357
|
async send(data) {
|
|
338
358
|
if (this.state === this.states.LOGOUT) {
|
|
339
359
|
// already logged out
|
|
@@ -803,6 +823,7 @@ class ImapFlow extends EventEmitter {
|
|
|
803
823
|
|
|
804
824
|
return resolve(true);
|
|
805
825
|
});
|
|
826
|
+
|
|
806
827
|
this.writeSocket = this.socket;
|
|
807
828
|
|
|
808
829
|
this.setSocketHandlers();
|
|
@@ -1105,9 +1126,9 @@ class ImapFlow extends EventEmitter {
|
|
|
1105
1126
|
}
|
|
1106
1127
|
|
|
1107
1128
|
if (range && typeof range === 'object' && !Array.isArray(range)) {
|
|
1108
|
-
if (range.all && Object.keys(range) === 1) {
|
|
1129
|
+
if (range.all && Object.keys(range).length === 1) {
|
|
1109
1130
|
range = '1:*';
|
|
1110
|
-
} else if (range.uid && Object.keys(range) === 1) {
|
|
1131
|
+
} else if (range.uid && Object.keys(range).length === 1) {
|
|
1111
1132
|
range = range.uid;
|
|
1112
1133
|
options.uid = true;
|
|
1113
1134
|
} else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "imapflow",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.114",
|
|
4
4
|
"description": "IMAP Client for Node",
|
|
5
5
|
"main": "./lib/imap-flow.js",
|
|
6
6
|
"scripts": {
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
"@babel/eslint-parser": "7.19.1",
|
|
31
31
|
"@babel/eslint-plugin": "7.19.1",
|
|
32
32
|
"@babel/plugin-syntax-class-properties": "7.12.13",
|
|
33
|
-
"@babel/preset-env": "7.
|
|
34
|
-
"@types/node": "18.11.
|
|
33
|
+
"@babel/preset-env": "7.20.2",
|
|
34
|
+
"@types/node": "18.11.9",
|
|
35
35
|
"braintree-jsdoc-template": "3.3.0",
|
|
36
|
-
"eslint": "8.
|
|
36
|
+
"eslint": "8.27.0",
|
|
37
37
|
"eslint-config-nodemailer": "1.2.0",
|
|
38
38
|
"eslint-config-prettier": "8.5.0",
|
|
39
39
|
"grunt": "1.5.3",
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
"iconv-lite": "0.6.3",
|
|
50
50
|
"libbase64": "1.2.1",
|
|
51
51
|
"libmime": "5.1.0",
|
|
52
|
-
"libqp": "
|
|
52
|
+
"libqp": "2.0.1",
|
|
53
53
|
"mailsplit": "5.3.2",
|
|
54
54
|
"nodemailer": "6.8.0",
|
|
55
|
-
"pino": "8.
|
|
55
|
+
"pino": "8.7.0",
|
|
56
56
|
"socks": "2.7.1"
|
|
57
57
|
}
|
|
58
58
|
}
|