@mavogel/awscdk-rootmail 0.1.42 → 0.1.43
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 +8 -8
- package/lib/rootmail.js +1 -1
- package/lib/ses-receive.js +1 -1
- package/node_modules/@aws-sdk/checksums/package.json +3 -3
- package/node_modules/@aws-sdk/client-cloudwatch-logs/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-cloudwatch-logs/package.json +4 -4
- package/node_modules/@aws-sdk/client-route-53/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-route-53/package.json +4 -4
- package/node_modules/@aws-sdk/client-s3/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-s3/package.json +7 -7
- package/node_modules/@aws-sdk/client-ses/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-ses/package.json +4 -4
- package/node_modules/@aws-sdk/client-ssm/dist-cjs/index.js +1 -1
- package/node_modules/@aws-sdk/client-ssm/package.json +4 -4
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js +1 -2
- package/node_modules/@aws-sdk/core/dist-es/submodules/client/setFeature.js +0 -2
- package/node_modules/@aws-sdk/core/package.json +4 -5
- package/node_modules/@aws-sdk/credential-provider-env/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-http/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +10 -10
- package/node_modules/@aws-sdk/credential-provider-login/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-node/package.json +8 -8
- package/node_modules/@aws-sdk/credential-provider-process/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +4 -4
- package/node_modules/@aws-sdk/middleware-sdk-s3/package.json +3 -3
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/package.json +3 -3
- package/node_modules/@aws-sdk/token-providers/package.json +4 -4
- package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.browser.js +8 -8
- package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.js +8 -8
- package/node_modules/@smithy/core/dist-es/submodules/retry/util-retry/StandardRetryStrategy.js +2 -2
- package/node_modules/@smithy/core/dist-es/submodules/retry/util-retry/retries-2026-config.js +6 -6
- package/node_modules/@smithy/core/dist-types/submodules/retry/util-retry/retries-2026-config.d.ts +16 -6
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/retry/util-retry/retries-2026-config.d.ts +16 -6
- package/node_modules/@smithy/core/package.json +1 -1
- package/node_modules/mailparser/CHANGELOG.md +7 -0
- package/node_modules/mailparser/package.json +3 -3
- package/node_modules/nodemailer/CHANGELOG.md +28 -0
- package/node_modules/nodemailer/README.md +21 -0
- package/node_modules/nodemailer/dist/cjs/addressparser/index.js +185 -2
- package/node_modules/nodemailer/dist/cjs/dkim/sign.js +2 -2
- package/node_modules/nodemailer/dist/cjs/errors.d.ts +2 -0
- package/node_modules/nodemailer/dist/cjs/errors.js +11 -1
- package/node_modules/nodemailer/dist/cjs/json-transport/index.js +2 -0
- package/node_modules/nodemailer/dist/cjs/mailer/index.d.ts +12 -2
- package/node_modules/nodemailer/dist/cjs/mailer/index.js +56 -4
- package/node_modules/nodemailer/dist/cjs/mailer/mail-message.d.ts +10 -0
- package/node_modules/nodemailer/dist/cjs/mime-funcs/index.d.ts +2 -1
- package/node_modules/nodemailer/dist/cjs/mime-funcs/index.js +72 -2
- package/node_modules/nodemailer/dist/cjs/mime-node/index.js +1 -73
- 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/shared/index.d.ts +23 -0
- package/node_modules/nodemailer/dist/cjs/shared/index.js +79 -0
- package/node_modules/nodemailer/dist/cjs/smtp-connection/index.js +6 -0
- package/node_modules/nodemailer/dist/cjs/smtp-pool/index.d.ts +10 -3
- package/node_modules/nodemailer/dist/cjs/smtp-pool/index.js +70 -12
- package/node_modules/nodemailer/dist/cjs/smtp-pool/pool-resource.js +26 -4
- package/node_modules/nodemailer/dist/cjs/smtp-transport/index.d.ts +1 -0
- package/node_modules/nodemailer/dist/cjs/smtp-transport/index.js +47 -35
- package/node_modules/nodemailer/dist/cjs/well-known/services.js +7 -0
- package/node_modules/nodemailer/dist/esm/addressparser/index.js +185 -2
- package/node_modules/nodemailer/dist/esm/dkim/sign.js +2 -2
- package/node_modules/nodemailer/dist/esm/errors.d.ts +2 -0
- package/node_modules/nodemailer/dist/esm/errors.js +9 -0
- package/node_modules/nodemailer/dist/esm/json-transport/index.js +2 -0
- package/node_modules/nodemailer/dist/esm/mailer/index.d.ts +12 -2
- package/node_modules/nodemailer/dist/esm/mailer/index.js +56 -4
- package/node_modules/nodemailer/dist/esm/mailer/mail-message.d.ts +10 -0
- package/node_modules/nodemailer/dist/esm/mime-funcs/index.d.ts +2 -1
- package/node_modules/nodemailer/dist/esm/mime-funcs/index.js +72 -2
- package/node_modules/nodemailer/dist/esm/mime-node/index.js +1 -73
- 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/shared/index.d.ts +23 -0
- package/node_modules/nodemailer/dist/esm/shared/index.js +78 -0
- package/node_modules/nodemailer/dist/esm/smtp-connection/index.js +6 -0
- package/node_modules/nodemailer/dist/esm/smtp-pool/index.d.ts +10 -3
- package/node_modules/nodemailer/dist/esm/smtp-pool/index.js +70 -12
- package/node_modules/nodemailer/dist/esm/smtp-pool/pool-resource.js +26 -4
- package/node_modules/nodemailer/dist/esm/smtp-transport/index.d.ts +1 -0
- package/node_modules/nodemailer/dist/esm/smtp-transport/index.js +47 -35
- package/node_modules/nodemailer/dist/esm/well-known/services.js +7 -0
- package/node_modules/nodemailer/dist/well-known/services.json +8 -0
- package/node_modules/nodemailer/package.json +7 -7
- package/package.json +7 -7
|
@@ -399,21 +399,21 @@ class DefaultRateLimiter {
|
|
|
399
399
|
}
|
|
400
400
|
|
|
401
401
|
class Retry {
|
|
402
|
-
static v2026 =
|
|
402
|
+
static v2026 = true;
|
|
403
403
|
static delay() {
|
|
404
|
-
return
|
|
404
|
+
return 50;
|
|
405
405
|
}
|
|
406
406
|
static throttlingDelay() {
|
|
407
|
-
return
|
|
407
|
+
return 1_000;
|
|
408
408
|
}
|
|
409
409
|
static cost() {
|
|
410
|
-
return
|
|
410
|
+
return 14;
|
|
411
411
|
}
|
|
412
412
|
static throttlingCost() {
|
|
413
|
-
return
|
|
413
|
+
return 5;
|
|
414
414
|
}
|
|
415
415
|
static modifiedCostType() {
|
|
416
|
-
return
|
|
416
|
+
return "THROTTLING";
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
419
|
|
|
@@ -494,7 +494,7 @@ let StandardRetryStrategy$1 = class StandardRetryStrategy {
|
|
|
494
494
|
this.retryBackoffStrategy ??= new DefaultRetryBackoffStrategy();
|
|
495
495
|
}
|
|
496
496
|
async acquireInitialRetryToken(retryTokenScope) {
|
|
497
|
-
return new DefaultRetryToken(Retry.delay(), 0, undefined,
|
|
497
|
+
return new DefaultRetryToken(Retry.delay(), 0, undefined, retryTokenScope.includes(":longpoll"));
|
|
498
498
|
}
|
|
499
499
|
async refreshRetryTokenForRetry(token, errorInfo) {
|
|
500
500
|
const maxAttempts = await this.getMaxAttempts();
|
|
@@ -510,7 +510,7 @@ let StandardRetryStrategy$1 = class StandardRetryStrategy {
|
|
|
510
510
|
retryDelay = Math.max(delayFromErrorType, Math.min(errorInfo.retryAfterHint.getTime() - Date.now(), delayFromErrorType + 5_000));
|
|
511
511
|
}
|
|
512
512
|
if (!shouldRetry) {
|
|
513
|
-
const longPollBackoff =
|
|
513
|
+
const longPollBackoff = retryCode === refusal.capacity && isLongPoll ? retryDelay : 0;
|
|
514
514
|
if (longPollBackoff > 0) {
|
|
515
515
|
await new Promise((r) => setTimeout(r, longPollBackoff));
|
|
516
516
|
}
|
|
@@ -401,21 +401,21 @@ class DefaultRateLimiter {
|
|
|
401
401
|
}
|
|
402
402
|
|
|
403
403
|
class Retry {
|
|
404
|
-
static v2026 =
|
|
404
|
+
static v2026 = true;
|
|
405
405
|
static delay() {
|
|
406
|
-
return
|
|
406
|
+
return 50;
|
|
407
407
|
}
|
|
408
408
|
static throttlingDelay() {
|
|
409
|
-
return
|
|
409
|
+
return 1_000;
|
|
410
410
|
}
|
|
411
411
|
static cost() {
|
|
412
|
-
return
|
|
412
|
+
return 14;
|
|
413
413
|
}
|
|
414
414
|
static throttlingCost() {
|
|
415
|
-
return
|
|
415
|
+
return 5;
|
|
416
416
|
}
|
|
417
417
|
static modifiedCostType() {
|
|
418
|
-
return
|
|
418
|
+
return "THROTTLING";
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
421
|
|
|
@@ -496,7 +496,7 @@ let StandardRetryStrategy$1 = class StandardRetryStrategy {
|
|
|
496
496
|
this.retryBackoffStrategy ??= new DefaultRetryBackoffStrategy();
|
|
497
497
|
}
|
|
498
498
|
async acquireInitialRetryToken(retryTokenScope) {
|
|
499
|
-
return new DefaultRetryToken(Retry.delay(), 0, undefined,
|
|
499
|
+
return new DefaultRetryToken(Retry.delay(), 0, undefined, retryTokenScope.includes(":longpoll"));
|
|
500
500
|
}
|
|
501
501
|
async refreshRetryTokenForRetry(token, errorInfo) {
|
|
502
502
|
const maxAttempts = await this.getMaxAttempts();
|
|
@@ -512,7 +512,7 @@ let StandardRetryStrategy$1 = class StandardRetryStrategy {
|
|
|
512
512
|
retryDelay = Math.max(delayFromErrorType, Math.min(errorInfo.retryAfterHint.getTime() - Date.now(), delayFromErrorType + 5_000));
|
|
513
513
|
}
|
|
514
514
|
if (!shouldRetry) {
|
|
515
|
-
const longPollBackoff =
|
|
515
|
+
const longPollBackoff = retryCode === refusal.capacity && isLongPoll ? retryDelay : 0;
|
|
516
516
|
if (longPollBackoff > 0) {
|
|
517
517
|
await new Promise((r) => setTimeout(r, longPollBackoff));
|
|
518
518
|
}
|
package/node_modules/@smithy/core/dist-es/submodules/retry/util-retry/StandardRetryStrategy.js
CHANGED
|
@@ -31,7 +31,7 @@ export class StandardRetryStrategy {
|
|
|
31
31
|
this.retryBackoffStrategy ??= new DefaultRetryBackoffStrategy();
|
|
32
32
|
}
|
|
33
33
|
async acquireInitialRetryToken(retryTokenScope) {
|
|
34
|
-
return new DefaultRetryToken(Retry.delay(), 0, undefined,
|
|
34
|
+
return new DefaultRetryToken(Retry.delay(), 0, undefined, retryTokenScope.includes(":longpoll"));
|
|
35
35
|
}
|
|
36
36
|
async refreshRetryTokenForRetry(token, errorInfo) {
|
|
37
37
|
const maxAttempts = await this.getMaxAttempts();
|
|
@@ -47,7 +47,7 @@ export class StandardRetryStrategy {
|
|
|
47
47
|
retryDelay = Math.max(delayFromErrorType, Math.min(errorInfo.retryAfterHint.getTime() - Date.now(), delayFromErrorType + 5_000));
|
|
48
48
|
}
|
|
49
49
|
if (!shouldRetry) {
|
|
50
|
-
const longPollBackoff =
|
|
50
|
+
const longPollBackoff = retryCode === refusal.capacity && isLongPoll ? retryDelay : 0;
|
|
51
51
|
if (longPollBackoff > 0) {
|
|
52
52
|
await new Promise((r) => setTimeout(r, longPollBackoff));
|
|
53
53
|
}
|
package/node_modules/@smithy/core/dist-es/submodules/retry/util-retry/retries-2026-config.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
export class Retry {
|
|
2
|
-
static v2026 =
|
|
2
|
+
static v2026 = true;
|
|
3
3
|
static delay() {
|
|
4
|
-
return
|
|
4
|
+
return 50;
|
|
5
5
|
}
|
|
6
6
|
static throttlingDelay() {
|
|
7
|
-
return
|
|
7
|
+
return 1_000;
|
|
8
8
|
}
|
|
9
9
|
static cost() {
|
|
10
|
-
return
|
|
10
|
+
return 14;
|
|
11
11
|
}
|
|
12
12
|
static throttlingCost() {
|
|
13
|
-
return
|
|
13
|
+
return 5;
|
|
14
14
|
}
|
|
15
15
|
static modifiedCostType() {
|
|
16
|
-
return
|
|
16
|
+
return "THROTTLING";
|
|
17
17
|
}
|
|
18
18
|
}
|
package/node_modules/@smithy/core/dist-types/submodules/retry/util-retry/retries-2026-config.d.ts
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* Retry parameters used by the standard retry strategy.
|
|
3
|
+
*
|
|
4
|
+
* The public constants in `./constants` keep their earlier values, which the
|
|
5
|
+
* deprecated pre-SRA retry strategy still uses.
|
|
6
|
+
*
|
|
2
7
|
* @internal
|
|
3
8
|
*/
|
|
4
9
|
export declare abstract class Retry {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
static
|
|
10
|
+
/**
|
|
11
|
+
* Always true. Kept because previously published packages read this flag.
|
|
12
|
+
*
|
|
13
|
+
* @deprecated the 2026 retry behavior is always enabled. May be removed in a future major version.
|
|
14
|
+
*/
|
|
15
|
+
static readonly v2026 = true;
|
|
16
|
+
static delay(): number;
|
|
17
|
+
static throttlingDelay(): number;
|
|
18
|
+
static cost(): number;
|
|
19
|
+
static throttlingCost(): number;
|
|
20
|
+
static modifiedCostType(): "THROTTLING";
|
|
11
21
|
}
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* Retry parameters used by the standard retry strategy.
|
|
3
|
+
*
|
|
4
|
+
* The public constants in `./constants` keep their earlier values, which the
|
|
5
|
+
* deprecated pre-SRA retry strategy still uses.
|
|
6
|
+
*
|
|
2
7
|
* @internal
|
|
3
8
|
*/
|
|
4
9
|
export declare abstract class Retry {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
static
|
|
10
|
+
/**
|
|
11
|
+
* Always true. Kept because previously published packages read this flag.
|
|
12
|
+
*
|
|
13
|
+
* @deprecated the 2026 retry behavior is always enabled. May be removed in a future major version.
|
|
14
|
+
*/
|
|
15
|
+
static readonly v2026 = true;
|
|
16
|
+
static delay(): number;
|
|
17
|
+
static throttlingDelay(): number;
|
|
18
|
+
static cost(): number;
|
|
19
|
+
static throttlingCost(): number;
|
|
20
|
+
static modifiedCostType(): "THROTTLING";
|
|
11
21
|
}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [3.14.3](https://github.com/nodemailer/mailparser/compare/v3.14.2...v3.14.3) (2026-11-10)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* update dependencies ([76cdfce](https://github.com/nodemailer/mailparser/commit/76cdfce245775bdbc71293734e05b6113fa4133d))
|
|
9
|
+
|
|
3
10
|
## [3.14.2](https://github.com/nodemailer/mailparser/compare/v3.14.1...v3.14.2) (2026-11-04)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mailparser",
|
|
3
|
-
"version": "3.14.
|
|
3
|
+
"version": "3.14.3",
|
|
4
4
|
"description": "Parse e-mails",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"html-to-text": "10.0.1",
|
|
98
98
|
"libmime": "5.6.4",
|
|
99
99
|
"linkify-it": "5.0.2",
|
|
100
|
-
"nodemailer": "10.
|
|
100
|
+
"nodemailer": "10.5.0",
|
|
101
101
|
"punycode.js": "2.3.1",
|
|
102
102
|
"tlds": "1.261.0"
|
|
103
103
|
},
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"prettier": "3.9.10",
|
|
113
113
|
"tsx": "4.23.15",
|
|
114
114
|
"typescript": "6.0.3",
|
|
115
|
-
"typescript-eslint": "8.72.
|
|
115
|
+
"typescript-eslint": "8.72.2"
|
|
116
116
|
},
|
|
117
117
|
"repository": {
|
|
118
118
|
"type": "git",
|
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## [10.5.0](https://github.com/nodemailer/nodemailer/compare/v10.4.1...v10.5.0) (2026-11-10)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **smtp:** support AbortSignal for individual sends ([#1911](https://github.com/nodemailer/nodemailer/issues/1911)) ([66387ed](https://github.com/nodemailer/nodemailer/commit/66387ed6f4bd26208b944b74b7329201ad77377b)), closes [#1910](https://github.com/nodemailer/nodemailer/issues/1910)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **dkim:** encode the d= domain the same way as the address headers ([#1908](https://github.com/nodemailer/nodemailer/issues/1908)) ([4ebf03f](https://github.com/nodemailer/nodemailer/commit/4ebf03fba33a96118c10afa340ce895a00549148))
|
|
14
|
+
* **mime-funcs:** encode header text that would be decoded as an invalid encoded word ([#1912](https://github.com/nodemailer/nodemailer/issues/1912)) ([7a7b942](https://github.com/nodemailer/nodemailer/commit/7a7b9427b632d8785190747ae2c62e88e77bc837))
|
|
15
|
+
|
|
16
|
+
## [10.4.1](https://github.com/nodemailer/nodemailer/compare/v10.4.0...v10.4.1) (2026-11-10)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* **addressparser:** read whitespace and comments around a dot of the domain as CFWS ([c2b9c41](https://github.com/nodemailer/nodemailer/commit/c2b9c41bb81b2294ebadd294ad15ff035a17d0a5))
|
|
22
|
+
* **mime-node:** hand a domain to the UTS-46 mapper without lowercasing it first ([093e4dd](https://github.com/nodemailer/nodemailer/commit/093e4dd60af8a21e7f06a49c7f889291728e966a))
|
|
23
|
+
|
|
24
|
+
## [10.4.0](https://github.com/nodemailer/nodemailer/compare/v10.3.1...v10.4.0) (2026-11-07)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Features
|
|
28
|
+
|
|
29
|
+
* let close({ force: true }) end pooled connections that are delivering a message ([aba943c](https://github.com/nodemailer/nodemailer/commit/aba943cf9d24493aca2a3e043df06beadc728feb))
|
|
30
|
+
|
|
3
31
|
## [10.3.1](https://github.com/nodemailer/nodemailer/compare/v10.3.0...v10.3.1) (2026-10-29)
|
|
4
32
|
|
|
5
33
|
|
|
@@ -14,6 +14,27 @@ See [nodemailer.com](https://nodemailer.com/) for documentation and terms.
|
|
|
14
14
|
|
|
15
15
|
Nodemailer targets Node.js 20 and later. The ES module build also runs on [Bun](https://bun.sh/) (tested against the latest release) and on [Cloudflare Workers](https://developers.cloudflare.com/workers/) with the `nodejs_compat` compatibility flag. On Workers only the SMTP based transports apply, `sendmail` needs a child process, and the runtime does not allow turning certificate validation off, so `tls.rejectUnauthorized: false` fails there with an error.
|
|
16
16
|
|
|
17
|
+
## Cancelling an individual SMTP send
|
|
18
|
+
|
|
19
|
+
Pass an `AbortSignal` in the message options to cancel one `sendMail()` call:
|
|
20
|
+
|
|
21
|
+
```js
|
|
22
|
+
await transporter.sendMail({
|
|
23
|
+
from: 'sender@example.com',
|
|
24
|
+
to: 'recipient@example.com',
|
|
25
|
+
text: 'Hello',
|
|
26
|
+
signal: AbortSignal.timeout(30_000)
|
|
27
|
+
});
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
This is supported by SMTP and pooled SMTP transports. A pre-aborted signal prevents processing; aborting later stops subsequent plugin processing, removes a queued message, or closes the SMTP connection assigned to that message. Other deliveries in the pool can continue. Both promise and callback forms report an error named `AbortError`, with `code: 'EABORT'` and the signal's reason as `cause`. The signal listener is removed when the send finishes.
|
|
31
|
+
|
|
32
|
+
Cancellation stops local processing; it does not prove that the SMTP server has not already accepted the message. Do not retry a cancelled send automatically on that assumption.
|
|
33
|
+
|
|
34
|
+
Work already started by a plugin or a custom `getSocket` hook requires that code's cooperation to stop. Nodemailer ignores late plugin completion and destroys a socket handed back after cancellation. Plugins can read `mail.data.signal` to cancel their own work.
|
|
35
|
+
|
|
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
|
+
|
|
17
38
|
## Having an issue?
|
|
18
39
|
|
|
19
40
|
#### First review the docs
|
|
@@ -48,6 +48,30 @@ class TokenList {
|
|
|
48
48
|
this.slots[at + 2] = end;
|
|
49
49
|
return this.length++;
|
|
50
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Offset of the first character of a token that is part of its value. A text run that is
|
|
53
|
+
* no plain slice of the field still spans the whitespace and control characters its value
|
|
54
|
+
* is trimmed of.
|
|
55
|
+
*/
|
|
56
|
+
contentStart(index) {
|
|
57
|
+
let start = this.slots[index * 3 + 1];
|
|
58
|
+
const end = this.slots[index * 3 + 2];
|
|
59
|
+
while (start < end && _isDroppedCode(this.str.charCodeAt(start))) {
|
|
60
|
+
start++;
|
|
61
|
+
}
|
|
62
|
+
return start;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Offset just past the last character of a token that is part of its value
|
|
66
|
+
*/
|
|
67
|
+
contentEnd(index) {
|
|
68
|
+
const start = this.slots[index * 3 + 1];
|
|
69
|
+
let end = this.slots[index * 3 + 2];
|
|
70
|
+
while (end > start && _isDroppedCode(this.str.charCodeAt(end - 1))) {
|
|
71
|
+
end--;
|
|
72
|
+
}
|
|
73
|
+
return end;
|
|
74
|
+
}
|
|
51
75
|
/**
|
|
52
76
|
* The character of an operator token, an empty string for a text run
|
|
53
77
|
*/
|
|
@@ -183,6 +207,44 @@ function _isSpaceCode(code) {
|
|
|
183
207
|
code === 0x3000 ||
|
|
184
208
|
code === 0xfeff);
|
|
185
209
|
}
|
|
210
|
+
/**
|
|
211
|
+
* Checks for the whitespace RFC 5322 folding whitespace is made of: SP and HTAB, plus the
|
|
212
|
+
* line break a fold carries. The other characters _isSpaceCode accepts are atext under
|
|
213
|
+
* RFC 6532, and parsers disagree on them: mailauth keeps U+00A0 in a domain, so joining a
|
|
214
|
+
* domain across one names a domain that reader never sees
|
|
215
|
+
*
|
|
216
|
+
* @param code Character code
|
|
217
|
+
* @return true if the character is folding whitespace
|
|
218
|
+
*/
|
|
219
|
+
function _isFoldingSpaceCode(code) {
|
|
220
|
+
return code === 0x20 || code === 0x09 || code === 0x0d || code === 0x0a;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Checks if every character in a stretch of the field is folding whitespace
|
|
224
|
+
*
|
|
225
|
+
* @param str The field
|
|
226
|
+
* @param from Offset of the first character
|
|
227
|
+
* @param to Offset just past the last one
|
|
228
|
+
* @return true if the stretch holds nothing but folding whitespace
|
|
229
|
+
*/
|
|
230
|
+
function _isFoldingGap(str, from, to) {
|
|
231
|
+
for (let i = from; i < to; i++) {
|
|
232
|
+
if (!_isFoldingSpaceCode(str.charCodeAt(i))) {
|
|
233
|
+
return false;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
return true;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Checks for a character the value of a text run is trimmed of, or leaves out: whitespace,
|
|
240
|
+
* C0 controls and DEL
|
|
241
|
+
*
|
|
242
|
+
* @param code Character code
|
|
243
|
+
* @return true if the character is not part of the value at the edge of a run
|
|
244
|
+
*/
|
|
245
|
+
function _isDroppedCode(code) {
|
|
246
|
+
return code < 0x20 || code === 0x7f || _isSpaceCode(code);
|
|
247
|
+
}
|
|
186
248
|
/**
|
|
187
249
|
* The characters JS `\w` matches without the unicode flag, the set the `\b` in
|
|
188
250
|
* LOOSE_TEXT_ADDR is read against. charCodeAt off either end of the string gives NaN,
|
|
@@ -233,6 +295,9 @@ const LEADING_QUOTED_STRING = /^"(?:[^"\\]|\\[\s\S])*"/;
|
|
|
233
295
|
* The scan is by index, a pattern such as /\s+@/ backtracks over a long whitespace run that
|
|
234
296
|
* no '@' follows.
|
|
235
297
|
*
|
|
298
|
+
* The whitespace around the dots of the domain that follows is dropped as well, see
|
|
299
|
+
* _joinDomainDotSpacing.
|
|
300
|
+
*
|
|
236
301
|
* @param value Value holding the '@'
|
|
237
302
|
* @param at Offset of the '@', or -1
|
|
238
303
|
* @return The value with the whitespace beside that '@' removed
|
|
@@ -249,7 +314,86 @@ function _joinAtSpacing(value, at) {
|
|
|
249
314
|
while (end < value.length && _isSpaceCode(value.charCodeAt(end))) {
|
|
250
315
|
end++;
|
|
251
316
|
}
|
|
252
|
-
|
|
317
|
+
const joined = start === at && end === at + 1 ? value : value.slice(0, start) + '@' + value.slice(end);
|
|
318
|
+
return _joinDomainDotSpacing(joined, start);
|
|
319
|
+
}
|
|
320
|
+
// The ASCII atext characters: printable, and none of the RFC 5322 specials
|
|
321
|
+
const ASCII_ATEXT = new Uint8Array(0x80);
|
|
322
|
+
for (let code = 0x21; code < 0x7f; code++) {
|
|
323
|
+
ASCII_ATEXT[code] = '()<>[]:;@\\,."'.indexOf(String.fromCharCode(code)) < 0 ? 1 : 0;
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Checks if a character can be part of an atom: anything but the specials, whitespace and
|
|
327
|
+
* the control characters (RFC 5322 3.2.3, with non-ASCII allowed as RFC 6532 does)
|
|
328
|
+
*
|
|
329
|
+
* @param code Character code
|
|
330
|
+
* @return true if the character is atext
|
|
331
|
+
*/
|
|
332
|
+
function _isAtextCode(code) {
|
|
333
|
+
return code < 0x80 ? ASCII_ATEXT[code] === 1 : !_isSpaceCode(code);
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Drops the whitespace around the dots of the domain behind the '@' at an offset.
|
|
337
|
+
*
|
|
338
|
+
* obs-domain is atoms with CFWS around the dots (RFC 5322 4.4), so 'user@victim.example
|
|
339
|
+
* .allowed.example' names user@victim.example.allowed.example. Read as two runs, the domain
|
|
340
|
+
* ended at the whitespace and the envelope went to victim.example, a different domain than
|
|
341
|
+
* the one an RFC 5322 parser, and an application validating the address with one, reads
|
|
342
|
+
* (GHSA-3q53-mvfw-q9v8). A comment around a dot reaches here as whitespace.
|
|
343
|
+
*
|
|
344
|
+
* Only SP, HTAB and a fold count as the whitespace, see _isFoldingSpaceCode.
|
|
345
|
+
*
|
|
346
|
+
* Only a dot with an atom on both sides joins, as for a conformant parser: whitespace that
|
|
347
|
+
* is not beside a dot ends the domain, and so does a dot that no atom follows, which keeps
|
|
348
|
+
* 'user@example.com .' from becoming a domain with a trailing dot. A domain literal is left
|
|
349
|
+
* alone. Everything from where the domain ends is kept as it is.
|
|
350
|
+
*
|
|
351
|
+
* @param value Value holding the '@'
|
|
352
|
+
* @param at Offset of the '@'
|
|
353
|
+
* @return The value with the whitespace around the dots of that domain removed
|
|
354
|
+
*/
|
|
355
|
+
function _joinDomainDotSpacing(value, at) {
|
|
356
|
+
const len = value.length;
|
|
357
|
+
// '[' is no atext, so a domain literal ends the walk before it starts
|
|
358
|
+
let pos = at + 1;
|
|
359
|
+
let spaced = false;
|
|
360
|
+
for (;;) {
|
|
361
|
+
const labelStart = pos;
|
|
362
|
+
while (pos < len && _isAtextCode(value.charCodeAt(pos))) {
|
|
363
|
+
pos++;
|
|
364
|
+
}
|
|
365
|
+
if (pos === labelStart) {
|
|
366
|
+
break;
|
|
367
|
+
}
|
|
368
|
+
// the dot, with the whitespace on either side of it, and the label behind it
|
|
369
|
+
let next = pos;
|
|
370
|
+
while (next < len && _isFoldingSpaceCode(value.charCodeAt(next))) {
|
|
371
|
+
next++;
|
|
372
|
+
}
|
|
373
|
+
if (value.charCodeAt(next) !== 0x2e) {
|
|
374
|
+
break;
|
|
375
|
+
}
|
|
376
|
+
next++;
|
|
377
|
+
while (next < len && _isFoldingSpaceCode(value.charCodeAt(next))) {
|
|
378
|
+
next++;
|
|
379
|
+
}
|
|
380
|
+
if (next >= len || !_isAtextCode(value.charCodeAt(next))) {
|
|
381
|
+
break;
|
|
382
|
+
}
|
|
383
|
+
spaced = spaced || next !== pos + 1;
|
|
384
|
+
pos = next;
|
|
385
|
+
}
|
|
386
|
+
if (!spaced) {
|
|
387
|
+
return value;
|
|
388
|
+
}
|
|
389
|
+
// every whitespace character the walk covered sits beside a dot
|
|
390
|
+
let domain = '';
|
|
391
|
+
for (let k = at + 1; k < pos; k++) {
|
|
392
|
+
if (!_isFoldingSpaceCode(value.charCodeAt(k))) {
|
|
393
|
+
domain += value.charAt(k);
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
return value.slice(0, at + 1) + domain + value.slice(pos);
|
|
253
397
|
}
|
|
254
398
|
/**
|
|
255
399
|
* Drops the whitespace beside the '@' that splits the domain off a value. That is the '@'
|
|
@@ -553,6 +697,15 @@ function _collectAddressParts(tokens, from, to) {
|
|
|
553
697
|
// whether the last text run holds nothing but quoted text so far, which is what a quoted
|
|
554
698
|
// local part is until the '@' after it joins the run
|
|
555
699
|
let lastTextPureQuoted = false;
|
|
700
|
+
// whether the last text run holds an unquoted '@', so that it runs on into a domain, and
|
|
701
|
+
// whether nothing but comments has come since it, see the join below
|
|
702
|
+
let lastTextHasAt = false;
|
|
703
|
+
let lastTextOpen = false;
|
|
704
|
+
// Where the last text run, or the last comment since it, ended in the field, and whether
|
|
705
|
+
// everything between it and the comments since was folding whitespace. The tokens are
|
|
706
|
+
// trimmed of any whitespace, so this is read off the field itself.
|
|
707
|
+
let gapFrom = 0;
|
|
708
|
+
let gapsFolding = true;
|
|
556
709
|
// Last character of the run each state is currently accumulating. Reading it back off
|
|
557
710
|
// the accumulator with slice(-1) makes the engine flatten the whole growing string on
|
|
558
711
|
// every token, which is quadratic over an address built from many comment-joined atoms
|
|
@@ -570,18 +723,27 @@ function _collectAddressParts(tokens, from, to) {
|
|
|
570
723
|
case '<':
|
|
571
724
|
state = 'address';
|
|
572
725
|
insideQuotes = false;
|
|
726
|
+
lastTextOpen = false;
|
|
573
727
|
break;
|
|
574
728
|
case '(':
|
|
575
729
|
state = 'comment';
|
|
576
730
|
insideQuotes = false;
|
|
731
|
+
gapsFolding = gapsFolding && _isFoldingGap(tokens.str, gapFrom, tokens.contentStart(i));
|
|
577
732
|
break;
|
|
578
733
|
case '"':
|
|
579
734
|
insideQuotes = !insideQuotes;
|
|
580
735
|
state = 'text';
|
|
736
|
+
lastTextOpen = false;
|
|
581
737
|
break;
|
|
582
738
|
default:
|
|
583
739
|
state = 'text';
|
|
584
740
|
insideQuotes = false;
|
|
741
|
+
if (value !== ')') {
|
|
742
|
+
lastTextOpen = false;
|
|
743
|
+
}
|
|
744
|
+
else {
|
|
745
|
+
gapFrom = tokens.contentEnd(i);
|
|
746
|
+
}
|
|
585
747
|
break;
|
|
586
748
|
}
|
|
587
749
|
}
|
|
@@ -598,8 +760,23 @@ function _collectAddressParts(tokens, from, to) {
|
|
|
598
760
|
// of the '@', but it cannot join two atoms into one: gluing across it would read
|
|
599
761
|
// 'user@example.com(x)evil.com' as the single domain 'example.comevil.com' and
|
|
600
762
|
// deliver to a domain the sender never named.
|
|
763
|
+
// A comment beside a dot of a domain is CFWS inside obs-domain, with or without
|
|
764
|
+
// folding whitespace around it, so 'user@victim.example(x).allowed.example' names
|
|
765
|
+
// one domain (GHSA-3q53-mvfw-q9v8). Any other whitespace in between keeps them apart.
|
|
766
|
+
// A ')' always leaves the walk in unquoted text, so neither needs checking here.
|
|
767
|
+
// Neither join across a comment takes in a second '@' once the run holds one: the
|
|
768
|
+
// address would then split at the last '@', and 'user@company(x).com@attacker.net',
|
|
769
|
+
// which an RFC 5322 parser reads as user@company.com, would go to attacker.net.
|
|
601
770
|
const parts = data[state];
|
|
602
|
-
const
|
|
771
|
+
const secondAt = lastTextHasAt && prevOperator === ')' && value.indexOf('@') >= 0;
|
|
772
|
+
const joinsDomain = !secondAt &&
|
|
773
|
+
lastTextOpen &&
|
|
774
|
+
lastTextHasAt &&
|
|
775
|
+
prevOperator === ')' &&
|
|
776
|
+
(lastChars.text === '.' || value.charAt(0) === '.') &&
|
|
777
|
+
gapsFolding &&
|
|
778
|
+
_isFoldingGap(tokens.str, gapFrom, tokens.contentStart(i));
|
|
779
|
+
const joins = joinsDomain || (!secondAt && prevNoBreak && parts.length > 0 && (prevOperator !== ')' || lastChars[state] === '@' || value.charAt(0) === '@'));
|
|
603
780
|
if (joins) {
|
|
604
781
|
const last = data[state].length - 1;
|
|
605
782
|
if (state === 'text' && !insideQuotes) {
|
|
@@ -624,6 +801,12 @@ function _collectAddressParts(tokens, from, to) {
|
|
|
624
801
|
lastTextPureQuoted = insideQuotes;
|
|
625
802
|
}
|
|
626
803
|
}
|
|
804
|
+
if (state === 'text') {
|
|
805
|
+
lastTextHasAt = (joins && lastTextHasAt) || (!insideQuotes && value.indexOf('@') >= 0);
|
|
806
|
+
lastTextOpen = true;
|
|
807
|
+
gapFrom = tokens.contentEnd(i);
|
|
808
|
+
gapsFolding = true;
|
|
809
|
+
}
|
|
627
810
|
}
|
|
628
811
|
}
|
|
629
812
|
// If there is no text but a comment, replace the two. A comment is never part of a
|
|
@@ -36,7 +36,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
const
|
|
39
|
+
const shared = __importStar(require("../shared/index.js"));
|
|
40
40
|
const mimeFuncs = __importStar(require("../mime-funcs/index.js"));
|
|
41
41
|
const node_crypto_1 = __importDefault(require("node:crypto"));
|
|
42
42
|
const errors = __importStar(require("../errors.js"));
|
|
@@ -103,7 +103,7 @@ function generateDKIMHeader(domainName, keySelector, fieldNames, hashAlgo, bodyH
|
|
|
103
103
|
'v=1',
|
|
104
104
|
'a=rsa-' + hashAlgo,
|
|
105
105
|
'c=relaxed/relaxed',
|
|
106
|
-
'd=' +
|
|
106
|
+
'd=' + shared.normalizeDomain(cleanTagValue(domainName), false),
|
|
107
107
|
'q=dns/txt',
|
|
108
108
|
's=' + cleanTagValue(keySelector),
|
|
109
109
|
'bh=' + bodyHash,
|
|
@@ -23,6 +23,7 @@ export declare const ERROR_CODES: {
|
|
|
23
23
|
readonly EMESSAGE: "Message delivery error";
|
|
24
24
|
readonly EOTP: "Invalid one-time passcode data (otp option)";
|
|
25
25
|
readonly ESTREAM: "Stream processing error";
|
|
26
|
+
readonly EABORT: "Message sending aborted";
|
|
26
27
|
readonly EAUTH: "Authentication failed";
|
|
27
28
|
readonly ENOAUTH: "Authentication credentials not provided";
|
|
28
29
|
readonly EOAUTH2: "OAuth2 token generation or refresh error";
|
|
@@ -51,6 +52,7 @@ export declare const EENVELOPE = "EENVELOPE";
|
|
|
51
52
|
export declare const EMESSAGE = "EMESSAGE";
|
|
52
53
|
export declare const EOTP = "EOTP";
|
|
53
54
|
export declare const ESTREAM = "ESTREAM";
|
|
55
|
+
export declare const EABORT = "EABORT";
|
|
54
56
|
export declare const EAUTH = "EAUTH";
|
|
55
57
|
export declare const ENOAUTH = "ENOAUTH";
|
|
56
58
|
export declare const EOAUTH2 = "EOAUTH2";
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* err.code = errors.ECONNECTION;
|
|
11
11
|
*/
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.ERR_ACCESS_DENIED = exports.isPermanentResponseCode = exports.isTransientError = exports.EFETCH = exports.EURLACCESS = exports.EFILEACCESS = exports.EPROXY = exports.ECONFIG = exports.ESES = exports.ESENDMAIL = exports.EMAXRECIPIENTS = exports.EMAXLIMIT = exports.EOAUTH2 = exports.ENOAUTH = exports.EAUTH = exports.ESTREAM = exports.EOTP = exports.EMESSAGE = exports.EENVELOPE = exports.EPROTOCOL = exports.EREQUIRETLS = exports.ETLS = exports.EDNS = exports.ESOCKET = exports.ETIMEDOUT = exports.ECONNECTION = exports.ERROR_CODES = void 0;
|
|
13
|
+
exports.ERR_ACCESS_DENIED = exports.isPermanentResponseCode = exports.isTransientError = exports.createAbortError = exports.EFETCH = exports.EURLACCESS = exports.EFILEACCESS = exports.EPROXY = exports.ECONFIG = exports.ESES = exports.ESENDMAIL = exports.EMAXRECIPIENTS = exports.EMAXLIMIT = exports.EOAUTH2 = exports.ENOAUTH = exports.EAUTH = exports.EABORT = exports.ESTREAM = exports.EOTP = exports.EMESSAGE = exports.EENVELOPE = exports.EPROTOCOL = exports.EREQUIRETLS = exports.ETLS = exports.EDNS = exports.ESOCKET = exports.ETIMEDOUT = exports.ECONNECTION = exports.ERROR_CODES = void 0;
|
|
14
14
|
/**
|
|
15
15
|
* Error code descriptions for documentation and debugging
|
|
16
16
|
*/
|
|
@@ -29,6 +29,7 @@ exports.ERROR_CODES = {
|
|
|
29
29
|
EMESSAGE: 'Message delivery error',
|
|
30
30
|
EOTP: 'Invalid one-time passcode data (otp option)',
|
|
31
31
|
ESTREAM: 'Stream processing error',
|
|
32
|
+
EABORT: 'Message sending aborted',
|
|
32
33
|
// Authentication errors
|
|
33
34
|
EAUTH: 'Authentication failed',
|
|
34
35
|
ENOAUTH: 'Authentication credentials not provided',
|
|
@@ -58,6 +59,7 @@ exports.EENVELOPE = 'EENVELOPE';
|
|
|
58
59
|
exports.EMESSAGE = 'EMESSAGE';
|
|
59
60
|
exports.EOTP = 'EOTP';
|
|
60
61
|
exports.ESTREAM = 'ESTREAM';
|
|
62
|
+
exports.EABORT = 'EABORT';
|
|
61
63
|
exports.EAUTH = 'EAUTH';
|
|
62
64
|
exports.ENOAUTH = 'ENOAUTH';
|
|
63
65
|
exports.EOAUTH2 = 'EOAUTH2';
|
|
@@ -70,6 +72,14 @@ exports.EPROXY = 'EPROXY';
|
|
|
70
72
|
exports.EFILEACCESS = 'EFILEACCESS';
|
|
71
73
|
exports.EURLACCESS = 'EURLACCESS';
|
|
72
74
|
exports.EFETCH = 'EFETCH';
|
|
75
|
+
/** Creates the error reported when a caller cancels an individual send. @internal */
|
|
76
|
+
const createAbortError = (signal) => {
|
|
77
|
+
const err = new Error('Message sending aborted', { cause: signal.reason });
|
|
78
|
+
err.name = 'AbortError';
|
|
79
|
+
err.code = exports.EABORT;
|
|
80
|
+
return err;
|
|
81
|
+
};
|
|
82
|
+
exports.createAbortError = createAbortError;
|
|
73
83
|
/**
|
|
74
84
|
* Tells whether the error ended the connection rather than rejected what was sent over it
|
|
75
85
|
*/
|
|
@@ -83,6 +83,8 @@ class JSONTransport {
|
|
|
83
83
|
}
|
|
84
84
|
delete data.envelope;
|
|
85
85
|
delete data.normalizedHeaders;
|
|
86
|
+
// the per-message AbortSignal is not message data
|
|
87
|
+
delete data.signal;
|
|
86
88
|
// the message field is the object itself with skipEncoding, the
|
|
87
89
|
// createTransport overload for that option types the result accordingly
|
|
88
90
|
return done(null, {
|