imapflow 1.0.119 → 1.0.120

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.
Files changed (2) hide show
  1. package/lib/imap-flow.js +12 -2
  2. package/package.json +7 -7
package/lib/imap-flow.js CHANGED
@@ -308,6 +308,11 @@ class ImapFlow extends EventEmitter {
308
308
  return;
309
309
  }
310
310
 
311
+ if (this.writeSocket.destroyed) {
312
+ this.socket.emit('error', 'Write socket destroyed');
313
+ return;
314
+ }
315
+
311
316
  let addLineBreak = !this.commandParts.length;
312
317
  if (typeof chunk === 'string') {
313
318
  if (addLineBreak) {
@@ -618,6 +623,8 @@ class ImapFlow extends EventEmitter {
618
623
  this.socket.on('end', this._socketEnd);
619
624
  this.socket.on('tlsClientError', this._socketError);
620
625
  this.socket.on('timeout', this._socketTimeout);
626
+
627
+ this.writeSocket.on('error', this._socketError);
621
628
  }
622
629
 
623
630
  clearSocketHandlers() {
@@ -736,6 +743,9 @@ class ImapFlow extends EventEmitter {
736
743
  readNext();
737
744
  }
738
745
  });
746
+ this.writeSocket.on('error', err => {
747
+ this.socket.emit('error', err);
748
+ });
739
749
 
740
750
  this._deflate.pipe(this.socket);
741
751
  this._deflate.on('error', err => {
@@ -1293,7 +1303,7 @@ class ImapFlow extends EventEmitter {
1293
1303
 
1294
1304
  this.writeSocket = this.socket;
1295
1305
 
1296
- this.socket.once('error', err => {
1306
+ this.socket.on('error', err => {
1297
1307
  clearTimeout(this.connectTimeout);
1298
1308
  clearTimeout(this.greetingTimeout);
1299
1309
  setImmediate(() => this.close());
@@ -2543,7 +2553,7 @@ class ImapFlow extends EventEmitter {
2543
2553
  let data = {};
2544
2554
 
2545
2555
  for (let [part, content] of response.bodyParts) {
2546
- let keyParts = part.split('.');
2556
+ let keyParts = part.split('.mime');
2547
2557
  if (keyParts.length === 1) {
2548
2558
  // content
2549
2559
  let key = keyParts[0];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imapflow",
3
- "version": "1.0.119",
3
+ "version": "1.0.120",
4
4
  "description": "IMAP Client for Node",
5
5
  "main": "./lib/imap-flow.js",
6
6
  "scripts": {
@@ -31,12 +31,12 @@
31
31
  "@babel/eslint-plugin": "7.19.1",
32
32
  "@babel/plugin-syntax-class-properties": "7.12.13",
33
33
  "@babel/preset-env": "7.20.2",
34
- "@types/node": "18.11.17",
34
+ "@types/node": "18.11.18",
35
35
  "braintree-jsdoc-template": "3.3.0",
36
- "eslint": "8.30.0",
36
+ "eslint": "8.33.0",
37
37
  "eslint-config-nodemailer": "1.2.0",
38
- "eslint-config-prettier": "8.5.0",
39
- "grunt": "1.5.3",
38
+ "eslint-config-prettier": "8.6.0",
39
+ "grunt": "1.6.1",
40
40
  "grunt-cli": "1.4.3",
41
41
  "grunt-contrib-nodeunit": "4.0.0",
42
42
  "grunt-eslint": "24.0.1",
@@ -48,10 +48,10 @@
48
48
  "encoding-japanese": "2.0.0",
49
49
  "iconv-lite": "0.6.3",
50
50
  "libbase64": "1.2.1",
51
- "libmime": "5.2.0",
51
+ "libmime": "5.2.1",
52
52
  "libqp": "2.0.1",
53
53
  "mailsplit": "5.4.0",
54
- "nodemailer": "6.8.0",
54
+ "nodemailer": "6.9.1",
55
55
  "pino": "8.8.0",
56
56
  "socks": "2.7.1"
57
57
  }