@mavogel/awscdk-rootmail 0.1.50 → 0.1.52
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/.jsii +4 -4
- package/lib/rootmail.js +1 -1
- package/lib/ses-receive.js +1 -1
- package/node_modules/@zone-eu/mailsplit/package.json +10 -5
- package/node_modules/libmime/CHANGELOG.md +7 -0
- package/node_modules/libmime/package.json +10 -6
- package/node_modules/libqp/CHANGELOG.md +7 -0
- package/node_modules/libqp/README.md +1 -1
- package/node_modules/libqp/dist/cjs/libqp.d.ts +8 -2
- package/node_modules/libqp/dist/cjs/libqp.js +159 -12
- package/node_modules/libqp/dist/esm/libqp.d.ts +8 -2
- package/node_modules/libqp/dist/esm/libqp.js +159 -12
- package/node_modules/libqp/lib/libqp.js +1 -1
- package/node_modules/libqp/package.json +14 -8
- package/node_modules/mailparser/CHANGELOG.md +7 -0
- package/node_modules/mailparser/package.json +10 -6
- package/node_modules/nodemailer/CHANGELOG.md +13 -0
- package/node_modules/nodemailer/README.md +4 -0
- package/node_modules/nodemailer/dist/cjs/fetch/cookies.js +4 -1
- package/node_modules/nodemailer/dist/cjs/package-info.d.ts +1 -1
- package/node_modules/nodemailer/dist/cjs/package-info.js +1 -1
- package/node_modules/nodemailer/dist/cjs/smtp-connection/index.d.ts +3 -0
- package/node_modules/nodemailer/dist/cjs/smtp-connection/index.js +11 -3
- package/node_modules/nodemailer/dist/esm/fetch/cookies.js +4 -1
- package/node_modules/nodemailer/dist/esm/package-info.d.ts +1 -1
- package/node_modules/nodemailer/dist/esm/package-info.js +1 -1
- package/node_modules/nodemailer/dist/esm/smtp-connection/index.d.ts +3 -0
- package/node_modules/nodemailer/dist/esm/smtp-connection/index.js +11 -3
- package/node_modules/nodemailer/package.json +11 -6
- package/package.json +3 -3
package/.jsii
CHANGED
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
"@aws-sdk/client-ses": "^3.1169.0",
|
|
15
15
|
"@aws-sdk/client-ssm": "^3.1169.0",
|
|
16
16
|
"cdk-nag": "^3.0.1",
|
|
17
|
-
"mailparser": "^3.14.
|
|
17
|
+
"mailparser": "^3.14.4",
|
|
18
18
|
"uuid": "^14.0.3"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@mavogel/mvc-projen": "^0.0.
|
|
21
|
+
"@mavogel/mvc-projen": "^0.0.76",
|
|
22
22
|
"aws-cdk-lib": "^2.263.0",
|
|
23
23
|
"constructs": "^10.5.1"
|
|
24
24
|
},
|
|
@@ -9620,6 +9620,6 @@
|
|
|
9620
9620
|
"symbolId": "src/ses-receive:SESReceiveProps"
|
|
9621
9621
|
}
|
|
9622
9622
|
},
|
|
9623
|
-
"version": "0.1.
|
|
9624
|
-
"fingerprint": "
|
|
9623
|
+
"version": "0.1.52",
|
|
9624
|
+
"fingerprint": "ALSmApaJU/JytgC4lQcPUi4rppWdBpr9vZ1LBpx5HS8="
|
|
9625
9625
|
}
|
package/lib/rootmail.js
CHANGED
|
@@ -11,7 +11,7 @@ const ses_receive_1 = require("./ses-receive");
|
|
|
11
11
|
* Rootmail construct
|
|
12
12
|
*/
|
|
13
13
|
class Rootmail extends constructs_1.Construct {
|
|
14
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@mavogel/awscdk-rootmail.Rootmail", version: "0.1.
|
|
14
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@mavogel/awscdk-rootmail.Rootmail", version: "0.1.52" };
|
|
15
15
|
/**
|
|
16
16
|
* The name parameter in SSM to store the domain name server.
|
|
17
17
|
*/
|
package/lib/ses-receive.js
CHANGED
|
@@ -11,7 +11,7 @@ const ses_receipt_ruleset_activation_1 = require("./ses-receipt-ruleset-activati
|
|
|
11
11
|
* SES Receive construct
|
|
12
12
|
*/
|
|
13
13
|
class SESReceive extends constructs_1.Construct {
|
|
14
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@mavogel/awscdk-rootmail.SESReceive", version: "0.1.
|
|
14
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@mavogel/awscdk-rootmail.SESReceive", version: "0.1.52" };
|
|
15
15
|
constructor(scope, id, props) {
|
|
16
16
|
super(scope, id);
|
|
17
17
|
const filteredEmailSubjects = props.filteredEmailSubjects || [];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zone-eu/mailsplit",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.31",
|
|
4
4
|
"description": "Split email messages into an object stream",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"license": "(MIT OR EUPL-1.1+)",
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"libbase64": "1.4.1",
|
|
28
|
-
"libmime": "5.6.
|
|
29
|
-
"libqp": "3.0.
|
|
28
|
+
"libmime": "5.6.5",
|
|
29
|
+
"libqp": "3.0.2"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@eslint/js": "10.0.1",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"@types/libqp": "1.1.3",
|
|
35
35
|
"@types/node": "26.6.6",
|
|
36
36
|
"c8": "12.0.0",
|
|
37
|
-
"eslint": "10.
|
|
37
|
+
"eslint": "10.15.0",
|
|
38
38
|
"eslint-config-prettier": "10.1.8",
|
|
39
39
|
"globals": "17.14.0",
|
|
40
|
-
"prettier": "3.
|
|
40
|
+
"prettier": "3.10.1",
|
|
41
41
|
"random-message": "1.1.0",
|
|
42
42
|
"typescript": "7.0.2"
|
|
43
43
|
},
|
|
@@ -49,5 +49,10 @@
|
|
|
49
49
|
"repository": {
|
|
50
50
|
"type": "git",
|
|
51
51
|
"url": "https://github.com/zone-eu/mailsplit.git"
|
|
52
|
+
},
|
|
53
|
+
"overrides": {
|
|
54
|
+
"glob": "14.0.6",
|
|
55
|
+
"minimatch": "11.0.8",
|
|
56
|
+
"mkdirp": "0.5.6"
|
|
52
57
|
}
|
|
53
58
|
}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [5.6.5](https://github.com/nodemailer/libmime/compare/v5.6.4...v5.6.5) (2026-11-15)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* update dependencies ([7b69694](https://github.com/nodemailer/libmime/commit/7b69694bc163d9d3c5d670ffa41ebae16c33ccc9))
|
|
9
|
+
|
|
3
10
|
## [5.6.4](https://github.com/nodemailer/libmime/compare/v5.6.3...v5.6.4) (2026-11-04)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "libmime",
|
|
3
3
|
"description": "Encode and decode quoted printable and base64 strings",
|
|
4
|
-
"version": "5.6.
|
|
4
|
+
"version": "5.6.5",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/cjs/libmime.js",
|
|
7
7
|
"types": "./dist/cjs/libmime.d.ts",
|
|
@@ -67,21 +67,25 @@
|
|
|
67
67
|
"encoding-japanese": "2.5.0",
|
|
68
68
|
"iconv-lite": "0.7.3",
|
|
69
69
|
"libbase64": "1.4.1",
|
|
70
|
-
"libqp": "3.0.
|
|
70
|
+
"libqp": "3.0.2"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@types/node": "20.19.43",
|
|
74
74
|
"c8": "12.0.0",
|
|
75
|
-
"eslint": "10.
|
|
75
|
+
"eslint": "10.15.0",
|
|
76
76
|
"eslint-config-prettier": "10.1.8",
|
|
77
77
|
"globals": "17.14.0",
|
|
78
|
-
"nodemailer": "10.
|
|
79
|
-
"prettier": "3.
|
|
78
|
+
"nodemailer": "10.6.0",
|
|
79
|
+
"prettier": "3.10.1",
|
|
80
80
|
"tsx": "4.23.15",
|
|
81
81
|
"typescript": "6.0.3",
|
|
82
|
-
"typescript-eslint": "8.72.
|
|
82
|
+
"typescript-eslint": "8.72.2"
|
|
83
83
|
},
|
|
84
84
|
"engines": {
|
|
85
85
|
"node": ">=20.0.0"
|
|
86
|
+
},
|
|
87
|
+
"overrides": {
|
|
88
|
+
"glob": "14.0.6",
|
|
89
|
+
"minimatch": "11.0.8"
|
|
86
90
|
}
|
|
87
91
|
}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [3.0.2](https://github.com/nodemailer/libqp/compare/v3.0.1...v3.0.2) (2026-11-15)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **decoder:** decode the input as it arrives instead of buffering it until the end ([#8](https://github.com/nodemailer/libqp/issues/8)) ([872ef59](https://github.com/nodemailer/libqp/commit/872ef59fc2efe59768ad43536600d29c1f590794))
|
|
9
|
+
|
|
3
10
|
## [3.0.1](https://github.com/nodemailer/libqp/compare/v3.0.0...v3.0.1) (2026-10-18)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -129,7 +129,7 @@ Where
|
|
|
129
129
|
|
|
130
130
|
- **options** is the optional stream options object
|
|
131
131
|
|
|
132
|
-
The Decoder
|
|
132
|
+
The Decoder decodes its input byte by byte as it arrives and holds back only what the following input can still change: whitespace that may end a line, a `=` that may start a soft line break, and an escape sequence that is not complete yet. Escape sequences and soft line breaks split between chunks or lines are decoded the same as with `decode()` of the whole input.
|
|
133
133
|
|
|
134
134
|
**Example**
|
|
135
135
|
|
|
@@ -52,8 +52,14 @@ export declare class Encoder extends Transform {
|
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
54
54
|
* Creates a transform stream for decoding Quoted-Printable encoded strings.
|
|
55
|
-
*
|
|
56
|
-
*
|
|
55
|
+
*
|
|
56
|
+
* Decodes byte by byte as the input arrives, in the three steps of decode(), each run as a small
|
|
57
|
+
* state machine: whitespace in front of a line break is removed, then soft line breaks, then
|
|
58
|
+
* escapes are decoded. Across chunks it carries only what the next bytes can still change: a run
|
|
59
|
+
* of whitespace that may turn out to end a line, a "=" (or "=" and a CR) that may start a soft
|
|
60
|
+
* line break, and a "=" (or "=" and a hex digit) that may start an escape. Escapes and soft line
|
|
61
|
+
* breaks split across chunks or lines decode the same as unsplit input ("==\nA=\nB" is the single
|
|
62
|
+
* byte 0xAB), and the output equals decode() of the whole input however the input is split.
|
|
57
63
|
*/
|
|
58
64
|
export declare class Decoder extends Transform {
|
|
59
65
|
options: DecoderOptions;
|
|
@@ -325,10 +325,20 @@ class Encoder extends node_stream_1.Transform {
|
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
327
|
exports.Encoder = Encoder;
|
|
328
|
+
/** The size the Decoder's buffer for a pending whitespace run starts at */
|
|
329
|
+
const BLANKS_START = 64;
|
|
330
|
+
/** A whitespace run buffer up to this size is kept for the next run, a larger one is dropped */
|
|
331
|
+
const BLANKS_KEEP = 64 * 1024;
|
|
328
332
|
/**
|
|
329
333
|
* Creates a transform stream for decoding Quoted-Printable encoded strings.
|
|
330
|
-
*
|
|
331
|
-
*
|
|
334
|
+
*
|
|
335
|
+
* Decodes byte by byte as the input arrives, in the three steps of decode(), each run as a small
|
|
336
|
+
* state machine: whitespace in front of a line break is removed, then soft line breaks, then
|
|
337
|
+
* escapes are decoded. Across chunks it carries only what the next bytes can still change: a run
|
|
338
|
+
* of whitespace that may turn out to end a line, a "=" (or "=" and a CR) that may start a soft
|
|
339
|
+
* line break, and a "=" (or "=" and a hex digit) that may start an escape. Escapes and soft line
|
|
340
|
+
* breaks split across chunks or lines decode the same as unsplit input ("==\nA=\nB" is the single
|
|
341
|
+
* byte 0xAB), and the output equals decode() of the whole input however the input is split.
|
|
332
342
|
*/
|
|
333
343
|
class Decoder extends node_stream_1.Transform {
|
|
334
344
|
/**
|
|
@@ -340,7 +350,14 @@ class Decoder extends node_stream_1.Transform {
|
|
|
340
350
|
this.options = opts;
|
|
341
351
|
this.inputBytes = 0;
|
|
342
352
|
this.outputBytes = 0;
|
|
343
|
-
this.
|
|
353
|
+
this._blanks = Buffer.alloc(0);
|
|
354
|
+
this._blankCount = 0;
|
|
355
|
+
this._soft = 0;
|
|
356
|
+
this._escape = 0;
|
|
357
|
+
this._escapeHigh = 0;
|
|
358
|
+
this._out = Buffer.alloc(0);
|
|
359
|
+
this._outPos = 0;
|
|
360
|
+
this._left = 0;
|
|
344
361
|
}
|
|
345
362
|
/** @internal */
|
|
346
363
|
_transform(chunk, encoding, done) {
|
|
@@ -348,23 +365,153 @@ class Decoder extends node_stream_1.Transform {
|
|
|
348
365
|
return done();
|
|
349
366
|
}
|
|
350
367
|
const buf = toBuffer(chunk, encoding);
|
|
351
|
-
// kept as a binary string, so joining the chunks is the only copy made before decoding
|
|
352
|
-
this.qpChunks.push(buf.toString('binary'));
|
|
353
368
|
this.inputBytes += buf.length;
|
|
369
|
+
// all output comes from input bytes: those of this chunk and those held back before it, at
|
|
370
|
+
// most four bytes of a soft line break and an escape, and whitespace (room made when it is kept)
|
|
371
|
+
this._begin(buf.length + 4);
|
|
372
|
+
for (let i = 0; i < buf.length; i++) {
|
|
373
|
+
this._left = buf.length - i;
|
|
374
|
+
this._trim(buf[i]);
|
|
375
|
+
}
|
|
376
|
+
this._left = 0;
|
|
377
|
+
this._end();
|
|
354
378
|
done();
|
|
355
379
|
}
|
|
356
380
|
/** @internal */
|
|
357
381
|
_flush(done) {
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
this.
|
|
364
|
-
this.
|
|
382
|
+
this._begin(4);
|
|
383
|
+
// whitespace at the end of the input is removed
|
|
384
|
+
this._dropBlanks();
|
|
385
|
+
if (this._soft === 2) {
|
|
386
|
+
// "=" and a CR at the end are no soft line break
|
|
387
|
+
this._unescape(0x3d);
|
|
388
|
+
this._unescape(0x0d);
|
|
389
|
+
}
|
|
390
|
+
// a "=" at the end is a soft line break and is removed
|
|
391
|
+
this._soft = 0;
|
|
392
|
+
if (this._escape >= 1) {
|
|
393
|
+
this._emit(0x3d);
|
|
365
394
|
}
|
|
395
|
+
if (this._escape === 2) {
|
|
396
|
+
this._emit(this._escapeHigh);
|
|
397
|
+
}
|
|
398
|
+
this._escape = 0;
|
|
399
|
+
this._end();
|
|
366
400
|
done();
|
|
367
401
|
}
|
|
402
|
+
/** Step 1, whitespace in front of a line break @internal */
|
|
403
|
+
_trim(byte) {
|
|
404
|
+
if (byte === 0x20 || byte === 0x09) {
|
|
405
|
+
if (this._blankCount === this._blanks.length) {
|
|
406
|
+
const blanks = Buffer.allocUnsafe(Math.max(BLANKS_START, this._blanks.length * 2));
|
|
407
|
+
this._blanks.copy(blanks, 0, 0, this._blankCount);
|
|
408
|
+
this._blanks = blanks;
|
|
409
|
+
}
|
|
410
|
+
this._blanks[this._blankCount++] = byte;
|
|
411
|
+
return;
|
|
412
|
+
}
|
|
413
|
+
if (this._blankCount) {
|
|
414
|
+
if (byte !== 0x0a && byte !== 0x0d) {
|
|
415
|
+
// not at the end of a line: the whitespace is kept. Its first byte completes what a
|
|
416
|
+
// "=" in front of it started; after that no soft line break or escape is pending, and
|
|
417
|
+
// the rest passes through both steps unchanged
|
|
418
|
+
this._reserve(this._blankCount);
|
|
419
|
+
this._soften(this._blanks[0]);
|
|
420
|
+
this._outPos += this._blanks.copy(this._out, this._outPos, 1, this._blankCount);
|
|
421
|
+
}
|
|
422
|
+
this._dropBlanks();
|
|
423
|
+
}
|
|
424
|
+
this._soften(byte);
|
|
425
|
+
}
|
|
426
|
+
/** Ends the pending whitespace run, keeping a small buffer for the next one @internal */
|
|
427
|
+
_dropBlanks() {
|
|
428
|
+
this._blankCount = 0;
|
|
429
|
+
if (this._blanks.length > BLANKS_KEEP) {
|
|
430
|
+
this._blanks = Buffer.alloc(0);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
/** Step 2, soft line breaks: "=" followed by LF or CR LF @internal */
|
|
434
|
+
_soften(byte) {
|
|
435
|
+
if (this._soft === 1) {
|
|
436
|
+
if (byte === 0x0a) {
|
|
437
|
+
this._soft = 0;
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
if (byte === 0x0d) {
|
|
441
|
+
this._soft = 2;
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
444
|
+
this._soft = 0;
|
|
445
|
+
this._unescape(0x3d);
|
|
446
|
+
}
|
|
447
|
+
else if (this._soft === 2) {
|
|
448
|
+
this._soft = 0;
|
|
449
|
+
if (byte === 0x0a) {
|
|
450
|
+
return;
|
|
451
|
+
}
|
|
452
|
+
this._unescape(0x3d);
|
|
453
|
+
this._unescape(0x0d);
|
|
454
|
+
}
|
|
455
|
+
if (byte === 0x3d) {
|
|
456
|
+
this._soft = 1;
|
|
457
|
+
return;
|
|
458
|
+
}
|
|
459
|
+
this._unescape(byte);
|
|
460
|
+
}
|
|
461
|
+
/** Step 3, escapes: "=" followed by two hex digits @internal */
|
|
462
|
+
_unescape(byte) {
|
|
463
|
+
if (this._escape === 1) {
|
|
464
|
+
if (hexValue(byte) >= 0) {
|
|
465
|
+
this._escape = 2;
|
|
466
|
+
this._escapeHigh = byte;
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
this._escape = 0;
|
|
470
|
+
this._emit(0x3d);
|
|
471
|
+
}
|
|
472
|
+
else if (this._escape === 2) {
|
|
473
|
+
this._escape = 0;
|
|
474
|
+
const low = hexValue(byte);
|
|
475
|
+
if (low >= 0) {
|
|
476
|
+
this._emit(hexValue(this._escapeHigh) * 16 + low);
|
|
477
|
+
return;
|
|
478
|
+
}
|
|
479
|
+
this._emit(0x3d);
|
|
480
|
+
this._emit(this._escapeHigh);
|
|
481
|
+
}
|
|
482
|
+
if (byte === 0x3d) {
|
|
483
|
+
this._escape = 1;
|
|
484
|
+
return;
|
|
485
|
+
}
|
|
486
|
+
this._emit(byte);
|
|
487
|
+
}
|
|
488
|
+
/** @internal */
|
|
489
|
+
_begin(size) {
|
|
490
|
+
this._out = Buffer.allocUnsafe(size);
|
|
491
|
+
this._outPos = 0;
|
|
492
|
+
}
|
|
493
|
+
/** Makes room for `size` more bytes besides the rest of the current chunk @internal */
|
|
494
|
+
_reserve(size) {
|
|
495
|
+
const needed = this._outPos + size + this._left + 4;
|
|
496
|
+
if (needed > this._out.length) {
|
|
497
|
+
const out = Buffer.allocUnsafe(Math.max(this._out.length * 2, needed));
|
|
498
|
+
this._out.copy(out, 0, 0, this._outPos);
|
|
499
|
+
this._out = out;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
/** @internal */
|
|
503
|
+
_emit(byte) {
|
|
504
|
+
this._out[this._outPos++] = byte;
|
|
505
|
+
}
|
|
506
|
+
/** @internal */
|
|
507
|
+
_end() {
|
|
508
|
+
if (this._outPos) {
|
|
509
|
+
this.outputBytes += this._outPos;
|
|
510
|
+
this.push(this._out.subarray(0, this._outPos));
|
|
511
|
+
}
|
|
512
|
+
this._out = Buffer.alloc(0);
|
|
513
|
+
this._outPos = 0;
|
|
514
|
+
}
|
|
368
515
|
}
|
|
369
516
|
exports.Decoder = Decoder;
|
|
370
517
|
const libqp = {
|
|
@@ -52,8 +52,14 @@ export declare class Encoder extends Transform {
|
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
54
54
|
* Creates a transform stream for decoding Quoted-Printable encoded strings.
|
|
55
|
-
*
|
|
56
|
-
*
|
|
55
|
+
*
|
|
56
|
+
* Decodes byte by byte as the input arrives, in the three steps of decode(), each run as a small
|
|
57
|
+
* state machine: whitespace in front of a line break is removed, then soft line breaks, then
|
|
58
|
+
* escapes are decoded. Across chunks it carries only what the next bytes can still change: a run
|
|
59
|
+
* of whitespace that may turn out to end a line, a "=" (or "=" and a CR) that may start a soft
|
|
60
|
+
* line break, and a "=" (or "=" and a hex digit) that may start an escape. Escapes and soft line
|
|
61
|
+
* breaks split across chunks or lines decode the same as unsplit input ("==\nA=\nB" is the single
|
|
62
|
+
* byte 0xAB), and the output equals decode() of the whole input however the input is split.
|
|
57
63
|
*/
|
|
58
64
|
export declare class Decoder extends Transform {
|
|
59
65
|
options: DecoderOptions;
|
|
@@ -318,10 +318,20 @@ export class Encoder extends Transform {
|
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
|
+
/** The size the Decoder's buffer for a pending whitespace run starts at */
|
|
322
|
+
const BLANKS_START = 64;
|
|
323
|
+
/** A whitespace run buffer up to this size is kept for the next run, a larger one is dropped */
|
|
324
|
+
const BLANKS_KEEP = 64 * 1024;
|
|
321
325
|
/**
|
|
322
326
|
* Creates a transform stream for decoding Quoted-Printable encoded strings.
|
|
323
|
-
*
|
|
324
|
-
*
|
|
327
|
+
*
|
|
328
|
+
* Decodes byte by byte as the input arrives, in the three steps of decode(), each run as a small
|
|
329
|
+
* state machine: whitespace in front of a line break is removed, then soft line breaks, then
|
|
330
|
+
* escapes are decoded. Across chunks it carries only what the next bytes can still change: a run
|
|
331
|
+
* of whitespace that may turn out to end a line, a "=" (or "=" and a CR) that may start a soft
|
|
332
|
+
* line break, and a "=" (or "=" and a hex digit) that may start an escape. Escapes and soft line
|
|
333
|
+
* breaks split across chunks or lines decode the same as unsplit input ("==\nA=\nB" is the single
|
|
334
|
+
* byte 0xAB), and the output equals decode() of the whole input however the input is split.
|
|
325
335
|
*/
|
|
326
336
|
export class Decoder extends Transform {
|
|
327
337
|
/**
|
|
@@ -333,7 +343,14 @@ export class Decoder extends Transform {
|
|
|
333
343
|
this.options = opts;
|
|
334
344
|
this.inputBytes = 0;
|
|
335
345
|
this.outputBytes = 0;
|
|
336
|
-
this.
|
|
346
|
+
this._blanks = Buffer.alloc(0);
|
|
347
|
+
this._blankCount = 0;
|
|
348
|
+
this._soft = 0;
|
|
349
|
+
this._escape = 0;
|
|
350
|
+
this._escapeHigh = 0;
|
|
351
|
+
this._out = Buffer.alloc(0);
|
|
352
|
+
this._outPos = 0;
|
|
353
|
+
this._left = 0;
|
|
337
354
|
}
|
|
338
355
|
/** @internal */
|
|
339
356
|
_transform(chunk, encoding, done) {
|
|
@@ -341,23 +358,153 @@ export class Decoder extends Transform {
|
|
|
341
358
|
return done();
|
|
342
359
|
}
|
|
343
360
|
const buf = toBuffer(chunk, encoding);
|
|
344
|
-
// kept as a binary string, so joining the chunks is the only copy made before decoding
|
|
345
|
-
this.qpChunks.push(buf.toString('binary'));
|
|
346
361
|
this.inputBytes += buf.length;
|
|
362
|
+
// all output comes from input bytes: those of this chunk and those held back before it, at
|
|
363
|
+
// most four bytes of a soft line break and an escape, and whitespace (room made when it is kept)
|
|
364
|
+
this._begin(buf.length + 4);
|
|
365
|
+
for (let i = 0; i < buf.length; i++) {
|
|
366
|
+
this._left = buf.length - i;
|
|
367
|
+
this._trim(buf[i]);
|
|
368
|
+
}
|
|
369
|
+
this._left = 0;
|
|
370
|
+
this._end();
|
|
347
371
|
done();
|
|
348
372
|
}
|
|
349
373
|
/** @internal */
|
|
350
374
|
_flush(done) {
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
this.
|
|
357
|
-
this.
|
|
375
|
+
this._begin(4);
|
|
376
|
+
// whitespace at the end of the input is removed
|
|
377
|
+
this._dropBlanks();
|
|
378
|
+
if (this._soft === 2) {
|
|
379
|
+
// "=" and a CR at the end are no soft line break
|
|
380
|
+
this._unescape(0x3d);
|
|
381
|
+
this._unescape(0x0d);
|
|
382
|
+
}
|
|
383
|
+
// a "=" at the end is a soft line break and is removed
|
|
384
|
+
this._soft = 0;
|
|
385
|
+
if (this._escape >= 1) {
|
|
386
|
+
this._emit(0x3d);
|
|
358
387
|
}
|
|
388
|
+
if (this._escape === 2) {
|
|
389
|
+
this._emit(this._escapeHigh);
|
|
390
|
+
}
|
|
391
|
+
this._escape = 0;
|
|
392
|
+
this._end();
|
|
359
393
|
done();
|
|
360
394
|
}
|
|
395
|
+
/** Step 1, whitespace in front of a line break @internal */
|
|
396
|
+
_trim(byte) {
|
|
397
|
+
if (byte === 0x20 || byte === 0x09) {
|
|
398
|
+
if (this._blankCount === this._blanks.length) {
|
|
399
|
+
const blanks = Buffer.allocUnsafe(Math.max(BLANKS_START, this._blanks.length * 2));
|
|
400
|
+
this._blanks.copy(blanks, 0, 0, this._blankCount);
|
|
401
|
+
this._blanks = blanks;
|
|
402
|
+
}
|
|
403
|
+
this._blanks[this._blankCount++] = byte;
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
if (this._blankCount) {
|
|
407
|
+
if (byte !== 0x0a && byte !== 0x0d) {
|
|
408
|
+
// not at the end of a line: the whitespace is kept. Its first byte completes what a
|
|
409
|
+
// "=" in front of it started; after that no soft line break or escape is pending, and
|
|
410
|
+
// the rest passes through both steps unchanged
|
|
411
|
+
this._reserve(this._blankCount);
|
|
412
|
+
this._soften(this._blanks[0]);
|
|
413
|
+
this._outPos += this._blanks.copy(this._out, this._outPos, 1, this._blankCount);
|
|
414
|
+
}
|
|
415
|
+
this._dropBlanks();
|
|
416
|
+
}
|
|
417
|
+
this._soften(byte);
|
|
418
|
+
}
|
|
419
|
+
/** Ends the pending whitespace run, keeping a small buffer for the next one @internal */
|
|
420
|
+
_dropBlanks() {
|
|
421
|
+
this._blankCount = 0;
|
|
422
|
+
if (this._blanks.length > BLANKS_KEEP) {
|
|
423
|
+
this._blanks = Buffer.alloc(0);
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
/** Step 2, soft line breaks: "=" followed by LF or CR LF @internal */
|
|
427
|
+
_soften(byte) {
|
|
428
|
+
if (this._soft === 1) {
|
|
429
|
+
if (byte === 0x0a) {
|
|
430
|
+
this._soft = 0;
|
|
431
|
+
return;
|
|
432
|
+
}
|
|
433
|
+
if (byte === 0x0d) {
|
|
434
|
+
this._soft = 2;
|
|
435
|
+
return;
|
|
436
|
+
}
|
|
437
|
+
this._soft = 0;
|
|
438
|
+
this._unescape(0x3d);
|
|
439
|
+
}
|
|
440
|
+
else if (this._soft === 2) {
|
|
441
|
+
this._soft = 0;
|
|
442
|
+
if (byte === 0x0a) {
|
|
443
|
+
return;
|
|
444
|
+
}
|
|
445
|
+
this._unescape(0x3d);
|
|
446
|
+
this._unescape(0x0d);
|
|
447
|
+
}
|
|
448
|
+
if (byte === 0x3d) {
|
|
449
|
+
this._soft = 1;
|
|
450
|
+
return;
|
|
451
|
+
}
|
|
452
|
+
this._unescape(byte);
|
|
453
|
+
}
|
|
454
|
+
/** Step 3, escapes: "=" followed by two hex digits @internal */
|
|
455
|
+
_unescape(byte) {
|
|
456
|
+
if (this._escape === 1) {
|
|
457
|
+
if (hexValue(byte) >= 0) {
|
|
458
|
+
this._escape = 2;
|
|
459
|
+
this._escapeHigh = byte;
|
|
460
|
+
return;
|
|
461
|
+
}
|
|
462
|
+
this._escape = 0;
|
|
463
|
+
this._emit(0x3d);
|
|
464
|
+
}
|
|
465
|
+
else if (this._escape === 2) {
|
|
466
|
+
this._escape = 0;
|
|
467
|
+
const low = hexValue(byte);
|
|
468
|
+
if (low >= 0) {
|
|
469
|
+
this._emit(hexValue(this._escapeHigh) * 16 + low);
|
|
470
|
+
return;
|
|
471
|
+
}
|
|
472
|
+
this._emit(0x3d);
|
|
473
|
+
this._emit(this._escapeHigh);
|
|
474
|
+
}
|
|
475
|
+
if (byte === 0x3d) {
|
|
476
|
+
this._escape = 1;
|
|
477
|
+
return;
|
|
478
|
+
}
|
|
479
|
+
this._emit(byte);
|
|
480
|
+
}
|
|
481
|
+
/** @internal */
|
|
482
|
+
_begin(size) {
|
|
483
|
+
this._out = Buffer.allocUnsafe(size);
|
|
484
|
+
this._outPos = 0;
|
|
485
|
+
}
|
|
486
|
+
/** Makes room for `size` more bytes besides the rest of the current chunk @internal */
|
|
487
|
+
_reserve(size) {
|
|
488
|
+
const needed = this._outPos + size + this._left + 4;
|
|
489
|
+
if (needed > this._out.length) {
|
|
490
|
+
const out = Buffer.allocUnsafe(Math.max(this._out.length * 2, needed));
|
|
491
|
+
this._out.copy(out, 0, 0, this._outPos);
|
|
492
|
+
this._out = out;
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
/** @internal */
|
|
496
|
+
_emit(byte) {
|
|
497
|
+
this._out[this._outPos++] = byte;
|
|
498
|
+
}
|
|
499
|
+
/** @internal */
|
|
500
|
+
_end() {
|
|
501
|
+
if (this._outPos) {
|
|
502
|
+
this.outputBytes += this._outPos;
|
|
503
|
+
this.push(this._out.subarray(0, this._outPos));
|
|
504
|
+
}
|
|
505
|
+
this._out = Buffer.alloc(0);
|
|
506
|
+
this._outPos = 0;
|
|
507
|
+
}
|
|
361
508
|
}
|
|
362
509
|
const libqp = {
|
|
363
510
|
encode,
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
|
|
3
3
|
// The pre-TypeScript entry point. Node resolves `libqp/lib/libqp` through the exports map and
|
|
4
4
|
// never loads this file, but resolvers that look for the path on disk and ignore the exports map
|
|
5
|
-
// (webpack 4, browserify, and @yao/pkg, which warns about the import without it) still find it.
|
|
5
|
+
// (webpack 4, browserify, and @yao-pkg/pkg, which warns about the import without it) still find it.
|
|
6
6
|
module.exports = require('../dist/cjs/libqp.js');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "libqp",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"description": "Encode and decode quoted-printable strings according to rfc2045",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/cjs/libqp.js",
|
|
@@ -37,9 +37,11 @@
|
|
|
37
37
|
"build": "node scripts/build.js",
|
|
38
38
|
"typecheck": "tsc -p tsconfig.json",
|
|
39
39
|
"pretest": "npm run build",
|
|
40
|
-
"test": "node --import tsx --test $(find test -name '*-test.ts')",
|
|
40
|
+
"test": "node --import tsx --test --test-concurrency=1 $(find test -name '*-test.ts')",
|
|
41
41
|
"pretest:coverage": "npm run build",
|
|
42
|
-
"test:coverage": "c8 node --import tsx --test $(find test -name '*-test.ts')",
|
|
42
|
+
"test:coverage": "c8 node --import tsx --test --test-concurrency=1 $(find test -name '*-test.ts')",
|
|
43
|
+
"pretest:cjs": "npm run build",
|
|
44
|
+
"test:cjs": "NODE_OPTIONS=--no-experimental-require-module node test/cjs-smoke.cjs",
|
|
43
45
|
"pretest:bun": "npm run build",
|
|
44
46
|
"test:bun": "bun test --timeout 60000 $(find ./test -name '*-test.ts')",
|
|
45
47
|
"format": "prettier --write \"**/*.{js,cjs,ts,json,md,yml,yaml}\"",
|
|
@@ -49,7 +51,7 @@
|
|
|
49
51
|
"prepare": "npm run build",
|
|
50
52
|
"update": "rm -rf node_modules package-lock.json && ncu -u && npm install",
|
|
51
53
|
"test:mutation": "node scripts/mutation-test.js",
|
|
52
|
-
"test:fuzz": "FUZZ_ITERATIONS=${FUZZ_ITERATIONS:-20000} FUZZ_SEED=${FUZZ_SEED:-random} node --import tsx --test test/property-test.ts test/legacy-test.ts"
|
|
54
|
+
"test:fuzz": "FUZZ_ITERATIONS=${FUZZ_ITERATIONS:-20000} FUZZ_SEED=${FUZZ_SEED:-random} node --import tsx --test --test-concurrency=1 test/property-test.ts test/legacy-test.ts"
|
|
53
55
|
},
|
|
54
56
|
"repository": {
|
|
55
57
|
"type": "git",
|
|
@@ -68,17 +70,21 @@
|
|
|
68
70
|
"devDependencies": {
|
|
69
71
|
"@types/node": "20.19.43",
|
|
70
72
|
"c8": "12.0.0",
|
|
71
|
-
"eslint": "10.
|
|
73
|
+
"eslint": "10.15.0",
|
|
72
74
|
"eslint-config-prettier": "10.1.8",
|
|
73
75
|
"fast-check": "4.10.2",
|
|
74
|
-
"globals": "17.
|
|
76
|
+
"globals": "17.14.0",
|
|
75
77
|
"libqp-legacy": "npm:libqp@2.1.3",
|
|
76
|
-
"prettier": "3.
|
|
78
|
+
"prettier": "3.10.1",
|
|
77
79
|
"tsx": "4.23.15",
|
|
78
80
|
"typescript": "6.0.3",
|
|
79
|
-
"typescript-eslint": "8.
|
|
81
|
+
"typescript-eslint": "8.72.2"
|
|
80
82
|
},
|
|
81
83
|
"engines": {
|
|
82
84
|
"node": ">=20.0.0"
|
|
85
|
+
},
|
|
86
|
+
"overrides": {
|
|
87
|
+
"glob": "14.0.6",
|
|
88
|
+
"minimatch": "11.0.8"
|
|
83
89
|
}
|
|
84
90
|
}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [3.14.4](https://github.com/nodemailer/mailparser/compare/v3.14.3...v3.14.4) (2026-11-15)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* update dependencies ([bc39266](https://github.com/nodemailer/mailparser/commit/bc39266c22fcd6156a2f5c4c81e84c72f1813ecd))
|
|
9
|
+
|
|
3
10
|
## [3.14.3](https://github.com/nodemailer/mailparser/compare/v3.14.2...v3.14.3) (2026-11-10)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mailparser",
|
|
3
|
-
"version": "3.14.
|
|
3
|
+
"version": "3.14.4",
|
|
4
4
|
"description": "Parse e-mails",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
|
@@ -92,24 +92,24 @@
|
|
|
92
92
|
],
|
|
93
93
|
"license": "MIT",
|
|
94
94
|
"dependencies": {
|
|
95
|
-
"@zone-eu/mailsplit": "5.4.
|
|
95
|
+
"@zone-eu/mailsplit": "5.4.31",
|
|
96
96
|
"he": "1.2.0",
|
|
97
97
|
"html-to-text": "10.0.1",
|
|
98
|
-
"libmime": "5.6.
|
|
98
|
+
"libmime": "5.6.5",
|
|
99
99
|
"linkify-it": "5.0.2",
|
|
100
|
-
"nodemailer": "10.
|
|
100
|
+
"nodemailer": "10.6.0",
|
|
101
101
|
"punycode.js": "2.3.1",
|
|
102
102
|
"tlds": "1.261.0"
|
|
103
103
|
},
|
|
104
104
|
"devDependencies": {
|
|
105
105
|
"@types/node": "20.19.43",
|
|
106
106
|
"c8": "12.0.0",
|
|
107
|
-
"eslint": "10.
|
|
107
|
+
"eslint": "10.15.0",
|
|
108
108
|
"eslint-config-prettier": "10.1.8",
|
|
109
109
|
"globals": "17.14.0",
|
|
110
110
|
"iconv": "3.0.1",
|
|
111
111
|
"iconv-lite": "0.7.3",
|
|
112
|
-
"prettier": "3.
|
|
112
|
+
"prettier": "3.10.1",
|
|
113
113
|
"tsx": "4.23.15",
|
|
114
114
|
"typescript": "6.0.3",
|
|
115
115
|
"typescript-eslint": "8.72.2"
|
|
@@ -126,5 +126,9 @@
|
|
|
126
126
|
},
|
|
127
127
|
"allowScripts": {
|
|
128
128
|
"iconv": true
|
|
129
|
+
},
|
|
130
|
+
"overrides": {
|
|
131
|
+
"glob": "14.0.6",
|
|
132
|
+
"minimatch": "11.0.8"
|
|
129
133
|
}
|
|
130
134
|
}
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## [10.6.0](https://github.com/nodemailer/nodemailer/compare/v10.5.0...v10.6.0) (2026-11-15)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **smtp:** add configurable socketCloseTimeout ([#1916](https://github.com/nodemailer/nodemailer/issues/1916)) ([7f04d0b](https://github.com/nodemailer/nodemailer/commit/7f04d0b78e887191c89775cf4a3063462b222aad)), closes [#1915](https://github.com/nodemailer/nodemailer/issues/1915)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* let Set-Cookie Max-Age take precedence over Expires ([#1917](https://github.com/nodemailer/nodemailer/issues/1917)) ([d6d6d44](https://github.com/nodemailer/nodemailer/commit/d6d6d44f5fbdf61936032d8865a1312c89c1804e))
|
|
14
|
+
* **smtp-connection:** close the TLS socket of an upgraded connection on Node 27 ([4135015](https://github.com/nodemailer/nodemailer/commit/4135015175398aaad5ac6e1866e91a758c432417))
|
|
15
|
+
|
|
3
16
|
## [10.5.0](https://github.com/nodemailer/nodemailer/compare/v10.4.1...v10.5.0) (2026-11-10)
|
|
4
17
|
|
|
5
18
|
|
|
@@ -35,6 +35,10 @@ Work already started by a plugin or a custom `getSocket` hook requires that code
|
|
|
35
35
|
|
|
36
36
|
Other bundled transports (stream, JSON, sendmail and SES) ignore the signal once the message is handed to them, so the message is sent normally. A signal that is already aborted, or aborts while plugins run, still cancels the send with `EABORT` on every transport, as that happens before the transport is called. A `signal` value that is not an `AbortSignal` fails the send with `ECONFIG`. Custom transports can opt in with `supportsAbortSignal: true`; their `send()` must register its abort listener synchronously, check for a pre-aborted signal, stop the work it owns, invoke its callback once, and remove the listener on completion.
|
|
37
37
|
|
|
38
|
+
## SMTP socket close timeout
|
|
39
|
+
|
|
40
|
+
When an SMTP connection closes, Nodemailer ends the socket and destroys it if the server has not closed its side within `socketCloseTimeout` milliseconds (default 5000). Set it to `0` to destroy the socket right away. This applies to SMTP and pooled SMTP, including aborted sends and `transporter.close({ force: true })`. It does not tell you whether the server accepted a message that was in flight.
|
|
41
|
+
|
|
38
42
|
## Having an issue?
|
|
39
43
|
|
|
40
44
|
#### First review the docs
|
|
@@ -131,6 +131,7 @@ class Cookies {
|
|
|
131
131
|
parse(cookieStr) {
|
|
132
132
|
const cookie = {};
|
|
133
133
|
let hasNameValue = false;
|
|
134
|
+
let hasMaxAge = false;
|
|
134
135
|
(cookieStr || '')
|
|
135
136
|
.toString()
|
|
136
137
|
.split(';')
|
|
@@ -158,7 +159,8 @@ class Cookies {
|
|
|
158
159
|
case 'expires': {
|
|
159
160
|
const expires = new Date(value);
|
|
160
161
|
// ignore date if can not parse it
|
|
161
|
-
if (expires.toString() !== 'Invalid Date') {
|
|
162
|
+
if (expires.toString() !== 'Invalid Date' && !hasMaxAge) {
|
|
163
|
+
// Max-Age has precedence when both attributes are present (RFC 6265 5.3)
|
|
162
164
|
cookie.expires = expires;
|
|
163
165
|
}
|
|
164
166
|
break;
|
|
@@ -175,6 +177,7 @@ class Cookies {
|
|
|
175
177
|
break;
|
|
176
178
|
case 'max-age':
|
|
177
179
|
cookie.expires = new Date(Date.now() + (Number(value) || 0) * 1000);
|
|
180
|
+
hasMaxAge = true;
|
|
178
181
|
break;
|
|
179
182
|
case 'secure':
|
|
180
183
|
cookie.secure = true;
|
|
@@ -42,6 +42,8 @@ export interface SMTPConnectionOptions {
|
|
|
42
42
|
greetingTimeout?: number | undefined;
|
|
43
43
|
/** Time of inactivity in ms until the connection is closed, defaults to 10 minutes */
|
|
44
44
|
socketTimeout?: number | undefined;
|
|
45
|
+
/** Time in ms to wait for the peer to close after ending the socket, defaults to 5 seconds. Set to 0 to destroy it immediately */
|
|
46
|
+
socketCloseTimeout?: number | undefined;
|
|
45
47
|
/** Largest single server response to accept in bytes, defaults to 1 MB */
|
|
46
48
|
maxResponseSize?: number | undefined;
|
|
47
49
|
/** Time to wait in ms for the DNS requests to be resolved, defaults to 30 seconds */
|
|
@@ -307,6 +309,7 @@ export type SMTPConnectionResponseAction = (str: string) => void;
|
|
|
307
309
|
* * **greetingTimeout** - Time to wait in ms until greeting message is received from the server (defaults to 30 seconds)
|
|
308
310
|
* * **connectionTimeout** - how many milliseconds to wait for the connection to establish (defaults to 2 minutes)
|
|
309
311
|
* * **socketTimeout** - Time of inactivity until the connection is closed (defaults to 10 minutes)
|
|
312
|
+
* * **socketCloseTimeout** - Time in ms to wait for the peer to close after ending the socket (defaults to 5 seconds, 0 destroys immediately)
|
|
310
313
|
* * **maxResponseSize** - Largest single server response to accept in bytes (defaults to 1 MB)
|
|
311
314
|
* * **dnsTimeout** - Time to wait in ms for the DNS requests to be resolved (defaults to 30 seconds)
|
|
312
315
|
* * **lmtp** - if true, uses LMTP instead of SMTP protocol
|
|
@@ -145,6 +145,7 @@ function maskAuthCommand(cmd) {
|
|
|
145
145
|
* * **greetingTimeout** - Time to wait in ms until greeting message is received from the server (defaults to 30 seconds)
|
|
146
146
|
* * **connectionTimeout** - how many milliseconds to wait for the connection to establish (defaults to 2 minutes)
|
|
147
147
|
* * **socketTimeout** - Time of inactivity until the connection is closed (defaults to 10 minutes)
|
|
148
|
+
* * **socketCloseTimeout** - Time in ms to wait for the peer to close after ending the socket (defaults to 5 seconds, 0 destroys immediately)
|
|
148
149
|
* * **maxResponseSize** - Largest single server response to accept in bytes (defaults to 1 MB)
|
|
149
150
|
* * **dnsTimeout** - Time to wait in ms for the DNS requests to be resolved (defaults to 30 seconds)
|
|
150
151
|
* * **lmtp** - if true, uses LMTP instead of SMTP protocol
|
|
@@ -468,11 +469,18 @@ class SMTPConnection extends node_events_1.EventEmitter {
|
|
|
468
469
|
return;
|
|
469
470
|
}
|
|
470
471
|
this._closing = true;
|
|
471
|
-
|
|
472
|
+
// anything but a non-negative finite number keeps the default grace period
|
|
473
|
+
const configuredCloseTimeout = this.options.socketCloseTimeout;
|
|
474
|
+
const socketCloseTimeout = typeof configuredCloseTimeout === 'number' && Number.isFinite(configuredCloseTimeout) && configuredCloseTimeout >= 0
|
|
475
|
+
? configuredCloseTimeout
|
|
476
|
+
: CLOSE_TIMEOUT;
|
|
477
|
+
const closeMethod = this.stage === 'init' || socketCloseTimeout === 0 ? 'destroy' : 'end';
|
|
472
478
|
this.logger.debug({
|
|
473
479
|
tnx: 'smtp'
|
|
474
480
|
}, 'Closing connection to the server using "%s"', closeMethod);
|
|
475
|
-
|
|
481
|
+
// after STARTTLS this is the TLS socket, tear that one down and not the plain socket it
|
|
482
|
+
// wraps (Node 27 exposes the wrapped socket as `.socket`)
|
|
483
|
+
const socket = this._socket;
|
|
476
484
|
// Detach any in-flight DATA stream from the socket so the source stream
|
|
477
485
|
// can be garbage-collected once the socket is gone.
|
|
478
486
|
if (this._currentDataStream) {
|
|
@@ -514,7 +522,7 @@ class SMTPConnection extends node_events_1.EventEmitter {
|
|
|
514
522
|
if (closeMethod === 'end') {
|
|
515
523
|
// end() only closes our side, a server that never closes its own would keep
|
|
516
524
|
// the socket, and the process with it, around for good
|
|
517
|
-
const closeTimer = setTimeout(() => socket.destroy(),
|
|
525
|
+
const closeTimer = setTimeout(() => socket.destroy(), socketCloseTimeout);
|
|
518
526
|
if (typeof closeTimer.unref === 'function') {
|
|
519
527
|
closeTimer.unref();
|
|
520
528
|
}
|
|
@@ -93,6 +93,7 @@ class Cookies {
|
|
|
93
93
|
parse(cookieStr) {
|
|
94
94
|
const cookie = {};
|
|
95
95
|
let hasNameValue = false;
|
|
96
|
+
let hasMaxAge = false;
|
|
96
97
|
(cookieStr || '')
|
|
97
98
|
.toString()
|
|
98
99
|
.split(';')
|
|
@@ -120,7 +121,8 @@ class Cookies {
|
|
|
120
121
|
case 'expires': {
|
|
121
122
|
const expires = new Date(value);
|
|
122
123
|
// ignore date if can not parse it
|
|
123
|
-
if (expires.toString() !== 'Invalid Date') {
|
|
124
|
+
if (expires.toString() !== 'Invalid Date' && !hasMaxAge) {
|
|
125
|
+
// Max-Age has precedence when both attributes are present (RFC 6265 5.3)
|
|
124
126
|
cookie.expires = expires;
|
|
125
127
|
}
|
|
126
128
|
break;
|
|
@@ -137,6 +139,7 @@ class Cookies {
|
|
|
137
139
|
break;
|
|
138
140
|
case 'max-age':
|
|
139
141
|
cookie.expires = new Date(Date.now() + (Number(value) || 0) * 1000);
|
|
142
|
+
hasMaxAge = true;
|
|
140
143
|
break;
|
|
141
144
|
case 'secure':
|
|
142
145
|
cookie.secure = true;
|
|
@@ -42,6 +42,8 @@ export interface SMTPConnectionOptions {
|
|
|
42
42
|
greetingTimeout?: number | undefined;
|
|
43
43
|
/** Time of inactivity in ms until the connection is closed, defaults to 10 minutes */
|
|
44
44
|
socketTimeout?: number | undefined;
|
|
45
|
+
/** Time in ms to wait for the peer to close after ending the socket, defaults to 5 seconds. Set to 0 to destroy it immediately */
|
|
46
|
+
socketCloseTimeout?: number | undefined;
|
|
45
47
|
/** Largest single server response to accept in bytes, defaults to 1 MB */
|
|
46
48
|
maxResponseSize?: number | undefined;
|
|
47
49
|
/** Time to wait in ms for the DNS requests to be resolved, defaults to 30 seconds */
|
|
@@ -307,6 +309,7 @@ export type SMTPConnectionResponseAction = (str: string) => void;
|
|
|
307
309
|
* * **greetingTimeout** - Time to wait in ms until greeting message is received from the server (defaults to 30 seconds)
|
|
308
310
|
* * **connectionTimeout** - how many milliseconds to wait for the connection to establish (defaults to 2 minutes)
|
|
309
311
|
* * **socketTimeout** - Time of inactivity until the connection is closed (defaults to 10 minutes)
|
|
312
|
+
* * **socketCloseTimeout** - Time in ms to wait for the peer to close after ending the socket (defaults to 5 seconds, 0 destroys immediately)
|
|
310
313
|
* * **maxResponseSize** - Largest single server response to accept in bytes (defaults to 1 MB)
|
|
311
314
|
* * **dnsTimeout** - Time to wait in ms for the DNS requests to be resolved (defaults to 30 seconds)
|
|
312
315
|
* * **lmtp** - if true, uses LMTP instead of SMTP protocol
|
|
@@ -107,6 +107,7 @@ function maskAuthCommand(cmd) {
|
|
|
107
107
|
* * **greetingTimeout** - Time to wait in ms until greeting message is received from the server (defaults to 30 seconds)
|
|
108
108
|
* * **connectionTimeout** - how many milliseconds to wait for the connection to establish (defaults to 2 minutes)
|
|
109
109
|
* * **socketTimeout** - Time of inactivity until the connection is closed (defaults to 10 minutes)
|
|
110
|
+
* * **socketCloseTimeout** - Time in ms to wait for the peer to close after ending the socket (defaults to 5 seconds, 0 destroys immediately)
|
|
110
111
|
* * **maxResponseSize** - Largest single server response to accept in bytes (defaults to 1 MB)
|
|
111
112
|
* * **dnsTimeout** - Time to wait in ms for the DNS requests to be resolved (defaults to 30 seconds)
|
|
112
113
|
* * **lmtp** - if true, uses LMTP instead of SMTP protocol
|
|
@@ -430,11 +431,18 @@ class SMTPConnection extends EventEmitter {
|
|
|
430
431
|
return;
|
|
431
432
|
}
|
|
432
433
|
this._closing = true;
|
|
433
|
-
|
|
434
|
+
// anything but a non-negative finite number keeps the default grace period
|
|
435
|
+
const configuredCloseTimeout = this.options.socketCloseTimeout;
|
|
436
|
+
const socketCloseTimeout = typeof configuredCloseTimeout === 'number' && Number.isFinite(configuredCloseTimeout) && configuredCloseTimeout >= 0
|
|
437
|
+
? configuredCloseTimeout
|
|
438
|
+
: CLOSE_TIMEOUT;
|
|
439
|
+
const closeMethod = this.stage === 'init' || socketCloseTimeout === 0 ? 'destroy' : 'end';
|
|
434
440
|
this.logger.debug({
|
|
435
441
|
tnx: 'smtp'
|
|
436
442
|
}, 'Closing connection to the server using "%s"', closeMethod);
|
|
437
|
-
|
|
443
|
+
// after STARTTLS this is the TLS socket, tear that one down and not the plain socket it
|
|
444
|
+
// wraps (Node 27 exposes the wrapped socket as `.socket`)
|
|
445
|
+
const socket = this._socket;
|
|
438
446
|
// Detach any in-flight DATA stream from the socket so the source stream
|
|
439
447
|
// can be garbage-collected once the socket is gone.
|
|
440
448
|
if (this._currentDataStream) {
|
|
@@ -476,7 +484,7 @@ class SMTPConnection extends EventEmitter {
|
|
|
476
484
|
if (closeMethod === 'end') {
|
|
477
485
|
// end() only closes our side, a server that never closes its own would keep
|
|
478
486
|
// the socket, and the process with it, around for good
|
|
479
|
-
const closeTimer = setTimeout(() => socket.destroy(),
|
|
487
|
+
const closeTimer = setTimeout(() => socket.destroy(), socketCloseTimeout);
|
|
480
488
|
if (typeof closeTimer.unref === 'function') {
|
|
481
489
|
closeTimer.unref();
|
|
482
490
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nodemailer",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.6.0",
|
|
4
4
|
"description": "Easy as cake e-mail sending from your Node.js applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/cjs/nodemailer.js",
|
|
@@ -132,6 +132,7 @@
|
|
|
132
132
|
"test:cjs": "NODE_OPTIONS=--no-experimental-require-module node test/package/cjs-smoke.cjs",
|
|
133
133
|
"pretest:bun": "npm run build",
|
|
134
134
|
"test:bun": "bun test --timeout 60000 $(find ./test \\( -name '*-test.ts' -o -name '*.test.ts' \\))",
|
|
135
|
+
"fuzz:addressparser": "node --import tsx scripts/fuzz-addressparser.js",
|
|
135
136
|
"format": "prettier --write \"**/*.{js,cjs,ts,json,md}\"",
|
|
136
137
|
"format:check": "prettier --check \"**/*.{js,cjs,ts,json,md}\"",
|
|
137
138
|
"lint": "eslint . && npm run typecheck",
|
|
@@ -153,26 +154,30 @@
|
|
|
153
154
|
},
|
|
154
155
|
"homepage": "https://nodemailer.com/",
|
|
155
156
|
"devDependencies": {
|
|
156
|
-
"@aws-sdk/client-sesv2": "3.
|
|
157
|
+
"@aws-sdk/client-sesv2": "3.1169.0",
|
|
157
158
|
"@types/node": "20.19.43",
|
|
158
159
|
"bunyan": "1.8.15",
|
|
159
160
|
"c8": "12.0.0",
|
|
160
|
-
"eslint": "10.
|
|
161
|
+
"eslint": "10.15.0",
|
|
161
162
|
"eslint-config-prettier": "10.1.8",
|
|
162
163
|
"globals": "17.14.0",
|
|
163
164
|
"libbase64": "1.4.1",
|
|
164
165
|
"libmime": "5.6.4",
|
|
165
166
|
"libqp": "3.0.1",
|
|
166
|
-
"mailauth": "8.0.
|
|
167
|
-
"prettier": "3.
|
|
167
|
+
"mailauth": "8.0.6",
|
|
168
|
+
"prettier": "3.10.1",
|
|
168
169
|
"proxy": "1.0.2",
|
|
169
170
|
"proxy-test-server": "1.0.0",
|
|
170
|
-
"smtp-server": "3.21.
|
|
171
|
+
"smtp-server": "3.21.4",
|
|
171
172
|
"tsx": "4.23.15",
|
|
172
173
|
"typescript": "6.0.3",
|
|
173
174
|
"typescript-eslint": "8.72.2"
|
|
174
175
|
},
|
|
175
176
|
"engines": {
|
|
176
177
|
"node": ">=20.0.0"
|
|
178
|
+
},
|
|
179
|
+
"overrides": {
|
|
180
|
+
"glob": "14.0.6",
|
|
181
|
+
"minimatch": "11.0.8"
|
|
177
182
|
}
|
|
178
183
|
}
|
package/package.json
CHANGED
|
@@ -84,10 +84,10 @@
|
|
|
84
84
|
"@aws-sdk/client-s3": "^3.1169.0",
|
|
85
85
|
"@aws-sdk/client-ses": "^3.1169.0",
|
|
86
86
|
"@aws-sdk/client-ssm": "^3.1169.0",
|
|
87
|
-
"@mavogel/mvc-projen": "^0.0.
|
|
87
|
+
"@mavogel/mvc-projen": "^0.0.76",
|
|
88
88
|
"cdk-nag": "^3.0.1",
|
|
89
89
|
"constructs": "^10.5.1",
|
|
90
|
-
"mailparser": "^3.14.
|
|
90
|
+
"mailparser": "^3.14.4",
|
|
91
91
|
"uuid": "^14.0.3"
|
|
92
92
|
},
|
|
93
93
|
"bundledDependencies": [
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
"publishConfig": {
|
|
123
123
|
"access": "public"
|
|
124
124
|
},
|
|
125
|
-
"version": "0.1.
|
|
125
|
+
"version": "0.1.52",
|
|
126
126
|
"jest": {
|
|
127
127
|
"coverageProvider": "v8",
|
|
128
128
|
"transformIgnorePatterns": [
|