@mavogel/awscdk-rootmail 0.0.307 → 0.0.309
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 +3 -3
- package/integ-tests/integ.rootmail.ts.snapshot/RootmailIntegTestStack.assets.json +32 -32
- package/integ-tests/integ.rootmail.ts.snapshot/RootmailIntegTestStack.template.json +12 -11
- package/integ-tests/integ.rootmail.ts.snapshot/SetupTestIntegStackDefaultTestDeployAssert6EB6FF77.assets.json +2 -2
- package/integ-tests/integ.rootmail.ts.snapshot/SetupTestIntegStackDefaultTestDeployAssert6EB6FF77.template.json +3 -3
- package/integ-tests/integ.rootmail.ts.snapshot/{asset.2b86f8b255c50c6eba274c368849bab1c7a3747c30ef5df4c96f8dea8fffa21e → asset.0cc54596504938d3858f36b8eaeb554817254230dfa52e23a70aad9e657b80b8}/index.js +1 -1
- package/integ-tests/integ.rootmail.ts.snapshot/{asset.f75274dd7677b6ef41f29d2dfc2c885b4f4e069d3fb8e67636bd89efd3f0fcad → asset.11281c9e2a2b601c3421513ba7c9be4b643b04ba6a934192e52e46def7ab0830}/index.js +1 -3
- package/integ-tests/integ.rootmail.ts.snapshot/{asset.9572b451243318765beb576ae7528096b3879783dbaab795c02c01d7f4e83438 → asset.11768574bbd12c5ed10f463a68797423c366b61535ebc1b14951661b92657fa5}/index.js +1 -1
- package/integ-tests/integ.rootmail.ts.snapshot/{asset.157ba1713f7224463b621261792d18081588ff306a9bc3f75e6c468fabbe1a60 → asset.409d1db869dd0ed635bff94c855031afc92e9ac918a5d09651dd0b5316db1433}/index.js +1 -1
- package/integ-tests/integ.rootmail.ts.snapshot/{asset.78b64aaf9aebb4eacbdd42197be10e9d5894360a642f7dcf79aeb84bb3552377 → asset.7144c5a47b3904b1aa4b27be73803a4b684f4ef765d9df8fa767779d37106254}/index.js +1 -1
- package/integ-tests/integ.rootmail.ts.snapshot/{asset.be7d56b509650f7f97c406a745d8335992726086995e4cb4aaf50417ab40e803 → asset.9709438d0fbb508ea9bfee8683a274b4f9492f5e527eb28e0bd9e2bc96b9a08f}/index.js +1 -1
- package/integ-tests/integ.rootmail.ts.snapshot/{asset.8621467f8f2410fb7445cc07fab37b2e996e541b6f7acb8549df9e88e1def73c → asset.aa3a06cb0aae2ae75b5bdf62921fd207503fd54b0e711ebb20274f3e6afd3bfa}/index.js +181 -183
- package/integ-tests/integ.rootmail.ts.snapshot/{asset.4c079063901e6478dbb5ace19e3123641ebf0da2ab648ecf52079c5bec154196 → asset.aca912f8a6aebc5dfd423aff79785b8fd7488473a4cf93aaa7ad0e442b548787}/index.js +1 -1
- package/integ-tests/integ.rootmail.ts.snapshot/{asset.6ae1d1fcc0e69b0216c406dcb73136e88857dfc9a29784c57838e1fb0f9f7496 → asset.ed72e1e93cae7d32d1a99c33e6f697428dc230c3922131e7ba121cc99a732f3f}/index.js +1 -1
- package/integ-tests/integ.rootmail.ts.snapshot/{asset.7e8a681794eff5fda1841caa360113df5488ecf944055a69b8f1e5a687e269f5 → asset.f61472ea141af20f69ebb7a7718158fcb95d72410c0c2a2e72cc59b1822873fc}/index.js +1 -1
- package/integ-tests/integ.rootmail.ts.snapshot/integ.json +1 -1
- package/integ-tests/integ.rootmail.ts.snapshot/manifest.json +5 -4
- package/integ-tests/integ.rootmail.ts.snapshot/tree.json +12 -11
- package/lib/rootmail.js +1 -1
- package/lib/ses-receive.js +3 -2
- package/node_modules/@aws-sdk/client-cloudwatch-logs/dist-cjs/runtimeConfig.js +4 -1
- package/node_modules/@aws-sdk/client-cloudwatch-logs/dist-es/runtimeConfig.js +4 -1
- package/node_modules/@aws-sdk/client-cloudwatch-logs/package.json +5 -5
- package/node_modules/@aws-sdk/client-route-53/dist-cjs/runtimeConfig.js +4 -1
- package/node_modules/@aws-sdk/client-route-53/dist-es/runtimeConfig.js +4 -1
- package/node_modules/@aws-sdk/client-route-53/package.json +5 -5
- package/node_modules/@aws-sdk/client-s3/dist-cjs/runtimeConfig.js +4 -1
- package/node_modules/@aws-sdk/client-s3/dist-es/runtimeConfig.js +4 -1
- package/node_modules/@aws-sdk/client-s3/package.json +9 -9
- package/node_modules/@aws-sdk/client-ses/dist-cjs/runtimeConfig.js +4 -1
- package/node_modules/@aws-sdk/client-ses/dist-es/runtimeConfig.js +4 -1
- package/node_modules/@aws-sdk/client-ses/package.json +5 -5
- package/node_modules/@aws-sdk/client-ssm/dist-cjs/runtimeConfig.js +4 -1
- package/node_modules/@aws-sdk/client-ssm/dist-es/runtimeConfig.js +4 -1
- package/node_modules/@aws-sdk/client-ssm/package.json +5 -5
- package/node_modules/@aws-sdk/client-sso/dist-cjs/runtimeConfig.js +4 -1
- package/node_modules/@aws-sdk/client-sso/dist-es/runtimeConfig.js +4 -1
- package/node_modules/@aws-sdk/client-sso/package.json +4 -4
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +2 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/index.js +1 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/index.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/index.d.ts +1 -0
- package/node_modules/@aws-sdk/core/package.json +1 -1
- package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +8 -8
- package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
- package/node_modules/@aws-sdk/middleware-flexible-checksums/package.json +2 -2
- package/node_modules/@aws-sdk/middleware-sdk-s3/package.json +2 -2
- package/node_modules/@aws-sdk/middleware-user-agent/package.json +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/runtimeConfig.js +4 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/runtimeConfig.js +4 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/runtimeConfig.js +4 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/runtimeConfig.js +4 -1
- package/node_modules/@aws-sdk/nested-clients/package.json +4 -4
- package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +2 -2
- package/node_modules/@aws-sdk/token-providers/README.md +9 -0
- package/node_modules/@aws-sdk/token-providers/dist-cjs/index.js +18 -1
- package/node_modules/@aws-sdk/token-providers/dist-es/fromEnvSigningName.js +13 -0
- package/node_modules/@aws-sdk/token-providers/dist-es/index.js +1 -0
- package/node_modules/@aws-sdk/token-providers/dist-types/fromEnvSigningName.d.ts +18 -0
- package/node_modules/@aws-sdk/token-providers/dist-types/index.d.ts +1 -0
- package/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromEnvSigningName.d.ts +11 -0
- package/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/index.d.ts +1 -0
- package/node_modules/@aws-sdk/token-providers/package.json +3 -2
- package/node_modules/@aws-sdk/util-user-agent-node/package.json +2 -2
- package/node_modules/cdk-nag/.jsii +2 -2
- package/node_modules/cdk-nag/lib/ignore-suppression-conditions.js +5 -5
- package/node_modules/cdk-nag/lib/nag-logger.js +2 -2
- package/node_modules/cdk-nag/lib/nag-pack.js +1 -1
- package/node_modules/cdk-nag/lib/nag-rules.js +1 -1
- package/node_modules/cdk-nag/lib/nag-suppressions.js +1 -1
- package/node_modules/cdk-nag/lib/packs/aws-solutions.js +1 -1
- package/node_modules/cdk-nag/lib/packs/hipaa-security.js +1 -1
- package/node_modules/cdk-nag/lib/packs/nist-800-53-r4.js +1 -1
- package/node_modules/cdk-nag/lib/packs/nist-800-53-r5.js +1 -1
- package/node_modules/cdk-nag/lib/packs/pci-dss-321.js +1 -1
- package/node_modules/cdk-nag/package.json +2 -2
- package/node_modules/mailparser/.ncurc.js +2 -1
- package/node_modules/mailparser/CHANGELOG.md +7 -0
- package/node_modules/mailparser/lib/mail-parser.js +1 -1
- package/node_modules/mailparser/package.json +4 -4
- package/node_modules/mailsplit/package.json +2 -2
- package/node_modules/nodemailer/.ncurc.js +2 -1
- package/node_modules/nodemailer/CHANGELOG.md +51 -0
- package/node_modules/nodemailer/README.md +2 -2
- package/node_modules/nodemailer/lib/dkim/index.js +1 -1
- package/node_modules/nodemailer/lib/mail-composer/index.js +14 -2
- package/node_modules/nodemailer/lib/nodemailer.js +5 -0
- package/node_modules/nodemailer/lib/ses-transport/index.js +53 -168
- package/node_modules/nodemailer/lib/smtp-connection/index.js +4 -2
- package/node_modules/nodemailer/lib/well-known/services.json +16 -0
- package/node_modules/nodemailer/package.json +5 -5
- package/node_modules/tlds/index.json +0 -5
- package/node_modules/tlds/package.json +1 -1
- package/package.json +1 -1
|
@@ -42,7 +42,7 @@ It's either a firewall issue, or your SMTP server blocks authentication attempts
|
|
|
42
42
|
- You might have the wrong value for the `secure` option. This should be set to `true` only for port 465. For every other port, it should be `false`. Setting it to `false` does not mean that Nodemailer would not use TLS. Nodemailer would still try to upgrade the connection to use TLS if the server supports it.
|
|
43
43
|
- Older Node versions do not fully support the certificate chain of the newest Let's Encrypt certificates. Either set [tls.rejectUnauthorized](https://nodejs.org/dist/latest-v16.x/docs/api/tls.html#tlsconnectoptions-callback) to `false` to skip chain verification or upgrade your Node version
|
|
44
44
|
|
|
45
|
-
```
|
|
45
|
+
```js
|
|
46
46
|
let configOptions = {
|
|
47
47
|
host: "smtp.example.com",
|
|
48
48
|
port: 587,
|
|
@@ -57,7 +57,7 @@ let configOptions = {
|
|
|
57
57
|
|
|
58
58
|
Node.js uses [c-ares](https://nodejs.org/en/docs/meta/topics/dependencies/#c-ares) to resolve domain names, not the DNS library provided by the system, so if you have some custom DNS routing set up, it might be ignored. Nodemailer runs [dns.resolve4()](https://nodejs.org/dist/latest-v16.x/docs/api/dns.html#dnsresolve4hostname-options-callback) and [dns.resolve6()](https://nodejs.org/dist/latest-v16.x/docs/api/dns.html#dnsresolve6hostname-options-callback) to resolve hostname into an IP address. If both calls fail, then Nodemailer will fall back to [dns.lookup()](https://nodejs.org/dist/latest-v16.x/docs/api/dns.html#dnslookuphostname-options-callback). If this does not work for you, you can hard code the IP address into the configuration like shown below. In that case, Nodemailer would not perform any DNS lookups.
|
|
59
59
|
|
|
60
|
-
```
|
|
60
|
+
```js
|
|
61
61
|
let configOptions = {
|
|
62
62
|
host: "1.2.3.4",
|
|
63
63
|
port: 465,
|
|
@@ -12,7 +12,7 @@ const path = require('path');
|
|
|
12
12
|
const crypto = require('crypto');
|
|
13
13
|
|
|
14
14
|
const DKIM_ALGO = 'sha256';
|
|
15
|
-
const MAX_MESSAGE_SIZE =
|
|
15
|
+
const MAX_MESSAGE_SIZE = 2 * 1024 * 1024; // buffer messages larger than this to disk
|
|
16
16
|
|
|
17
17
|
/*
|
|
18
18
|
// Usage:
|
|
@@ -86,20 +86,32 @@ class MailComposer {
|
|
|
86
86
|
let icalEvent, eventObject;
|
|
87
87
|
let attachments = [].concat(this.mail.attachments || []).map((attachment, i) => {
|
|
88
88
|
let data;
|
|
89
|
-
let isMessageNode = /^message\//i.test(attachment.contentType);
|
|
90
89
|
|
|
91
90
|
if (/^data:/i.test(attachment.path || attachment.href)) {
|
|
92
91
|
attachment = this._processDataUrl(attachment);
|
|
93
92
|
}
|
|
94
93
|
|
|
95
94
|
let contentType = attachment.contentType || mimeFuncs.detectMimeType(attachment.filename || attachment.path || attachment.href || 'bin');
|
|
95
|
+
|
|
96
96
|
let isImage = /^image\//i.test(contentType);
|
|
97
|
+
let isMessageNode = /^message\//i.test(contentType);
|
|
98
|
+
|
|
97
99
|
let contentDisposition = attachment.contentDisposition || (isMessageNode || (isImage && attachment.cid) ? 'inline' : 'attachment');
|
|
98
100
|
|
|
101
|
+
let contentTransferEncoding;
|
|
102
|
+
if ('contentTransferEncoding' in attachment) {
|
|
103
|
+
// also contains `false`, to set
|
|
104
|
+
contentTransferEncoding = attachment.contentTransferEncoding;
|
|
105
|
+
} else if (isMessageNode) {
|
|
106
|
+
contentTransferEncoding = '7bit';
|
|
107
|
+
} else {
|
|
108
|
+
contentTransferEncoding = 'base64'; // the default
|
|
109
|
+
}
|
|
110
|
+
|
|
99
111
|
data = {
|
|
100
112
|
contentType,
|
|
101
113
|
contentDisposition,
|
|
102
|
-
contentTransferEncoding
|
|
114
|
+
contentTransferEncoding
|
|
103
115
|
};
|
|
104
116
|
|
|
105
117
|
if (attachment.filename) {
|
|
@@ -45,6 +45,11 @@ module.exports.createTransport = function (transporter, defaults) {
|
|
|
45
45
|
} else if (options.jsonTransport) {
|
|
46
46
|
transporter = new JSONTransport(options);
|
|
47
47
|
} else if (options.SES) {
|
|
48
|
+
if (options.SES.ses && options.SES.aws) {
|
|
49
|
+
let error = new Error('Using legacy SES configuration, expecting @aws-sdk/client-sesv2, see https://nodemailer.com/transports/ses/');
|
|
50
|
+
error.code = 'LegacyConfig';
|
|
51
|
+
throw error;
|
|
52
|
+
}
|
|
48
53
|
transporter = new SESTransport(options);
|
|
49
54
|
} else {
|
|
50
55
|
transporter = new SMTPTransport(options);
|
|
@@ -4,15 +4,11 @@ const EventEmitter = require('events');
|
|
|
4
4
|
const packageData = require('../../package.json');
|
|
5
5
|
const shared = require('../shared');
|
|
6
6
|
const LeWindows = require('../mime-node/le-windows');
|
|
7
|
+
const MimeNode = require('../mime-node');
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Generates a Transport object for AWS SES
|
|
10
11
|
*
|
|
11
|
-
* Possible options can be the following:
|
|
12
|
-
*
|
|
13
|
-
* * **sendingRate** optional Number specifying how many messages per second should be delivered to SES
|
|
14
|
-
* * **maxConnections** optional Number specifying max number of parallel connections to SES
|
|
15
|
-
*
|
|
16
12
|
* @constructor
|
|
17
13
|
* @param {Object} optional config parameter
|
|
18
14
|
*/
|
|
@@ -30,119 +26,17 @@ class SESTransport extends EventEmitter {
|
|
|
30
26
|
this.logger = shared.getLogger(this.options, {
|
|
31
27
|
component: this.options.component || 'ses-transport'
|
|
32
28
|
});
|
|
33
|
-
|
|
34
|
-
// parallel sending connections
|
|
35
|
-
this.maxConnections = Number(this.options.maxConnections) || Infinity;
|
|
36
|
-
this.connections = 0;
|
|
37
|
-
|
|
38
|
-
// max messages per second
|
|
39
|
-
this.sendingRate = Number(this.options.sendingRate) || Infinity;
|
|
40
|
-
this.sendingRateTTL = null;
|
|
41
|
-
this.rateInterval = 1000; // milliseconds
|
|
42
|
-
this.rateMessages = [];
|
|
43
|
-
|
|
44
|
-
this.pending = [];
|
|
45
|
-
|
|
46
|
-
this.idling = true;
|
|
47
|
-
|
|
48
|
-
setImmediate(() => {
|
|
49
|
-
if (this.idling) {
|
|
50
|
-
this.emit('idle');
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Schedules a sending of a message
|
|
57
|
-
*
|
|
58
|
-
* @param {Object} emailMessage MailComposer object
|
|
59
|
-
* @param {Function} callback Callback function to run when the sending is completed
|
|
60
|
-
*/
|
|
61
|
-
send(mail, callback) {
|
|
62
|
-
if (this.connections >= this.maxConnections) {
|
|
63
|
-
this.idling = false;
|
|
64
|
-
return this.pending.push({
|
|
65
|
-
mail,
|
|
66
|
-
callback
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
if (!this._checkSendingRate()) {
|
|
71
|
-
this.idling = false;
|
|
72
|
-
return this.pending.push({
|
|
73
|
-
mail,
|
|
74
|
-
callback
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
this._send(mail, (...args) => {
|
|
79
|
-
setImmediate(() => callback(...args));
|
|
80
|
-
this._sent();
|
|
81
|
-
});
|
|
82
29
|
}
|
|
83
30
|
|
|
84
|
-
|
|
85
|
-
if (this.
|
|
86
|
-
|
|
31
|
+
getRegion(cb) {
|
|
32
|
+
if (this.ses.sesClient.config && typeof this.ses.sesClient.config.region === 'function') {
|
|
33
|
+
// promise
|
|
34
|
+
return this.ses.sesClient.config
|
|
35
|
+
.region()
|
|
36
|
+
.then(region => cb(null, region))
|
|
37
|
+
.catch(err => cb(err));
|
|
87
38
|
}
|
|
88
|
-
|
|
89
|
-
if (!this.pending.length) {
|
|
90
|
-
if (!this.idling) {
|
|
91
|
-
this.idling = true;
|
|
92
|
-
this.emit('idle');
|
|
93
|
-
}
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
let next = this.pending.shift();
|
|
98
|
-
this._send(next.mail, (...args) => {
|
|
99
|
-
setImmediate(() => next.callback(...args));
|
|
100
|
-
this._sent();
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
_checkSendingRate() {
|
|
105
|
-
clearTimeout(this.sendingRateTTL);
|
|
106
|
-
|
|
107
|
-
let now = Date.now();
|
|
108
|
-
let oldest = false;
|
|
109
|
-
// delete older messages
|
|
110
|
-
for (let i = this.rateMessages.length - 1; i >= 0; i--) {
|
|
111
|
-
if (this.rateMessages[i].ts >= now - this.rateInterval && (!oldest || this.rateMessages[i].ts < oldest)) {
|
|
112
|
-
oldest = this.rateMessages[i].ts;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
if (this.rateMessages[i].ts < now - this.rateInterval && !this.rateMessages[i].pending) {
|
|
116
|
-
this.rateMessages.splice(i, 1);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
if (this.rateMessages.length < this.sendingRate) {
|
|
121
|
-
return true;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
let delay = Math.max(oldest + 1001, now + 20);
|
|
125
|
-
this.sendingRateTTL = setTimeout(() => this._checkRatedQueue(), now - delay);
|
|
126
|
-
|
|
127
|
-
try {
|
|
128
|
-
this.sendingRateTTL.unref();
|
|
129
|
-
} catch (E) {
|
|
130
|
-
// Ignore. Happens on envs with non-node timer implementation
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
return false;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
_sent() {
|
|
137
|
-
this.connections--;
|
|
138
|
-
this._checkRatedQueue();
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Returns true if there are free slots in the queue
|
|
143
|
-
*/
|
|
144
|
-
isIdle() {
|
|
145
|
-
return this.idling;
|
|
39
|
+
return cb(null, false);
|
|
146
40
|
}
|
|
147
41
|
|
|
148
42
|
/**
|
|
@@ -151,13 +45,17 @@ class SESTransport extends EventEmitter {
|
|
|
151
45
|
* @param {Object} emailMessage MailComposer object
|
|
152
46
|
* @param {Function} callback Callback function to run when the sending is completed
|
|
153
47
|
*/
|
|
154
|
-
|
|
48
|
+
send(mail, callback) {
|
|
155
49
|
let statObject = {
|
|
156
50
|
ts: Date.now(),
|
|
157
51
|
pending: true
|
|
158
52
|
};
|
|
159
|
-
|
|
160
|
-
|
|
53
|
+
|
|
54
|
+
let fromHeader = mail.message._headers.find(header => /^from$/i.test(header.key));
|
|
55
|
+
if (fromHeader) {
|
|
56
|
+
let mimeNode = new MimeNode('text/plain');
|
|
57
|
+
fromHeader = mimeNode._convertAddresses(mimeNode._parseAddresses(fromHeader.value));
|
|
58
|
+
}
|
|
161
59
|
|
|
162
60
|
let envelope = mail.data.envelope || mail.message.getEnvelope();
|
|
163
61
|
let messageId = mail.message.messageId();
|
|
@@ -227,45 +125,29 @@ class SESTransport extends EventEmitter {
|
|
|
227
125
|
}
|
|
228
126
|
|
|
229
127
|
let sesMessage = {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
128
|
+
Content: {
|
|
129
|
+
Raw: {
|
|
130
|
+
// required
|
|
131
|
+
Data: raw // required
|
|
132
|
+
}
|
|
233
133
|
},
|
|
234
|
-
|
|
235
|
-
|
|
134
|
+
FromEmailAddress: fromHeader ? fromHeader : envelope.from,
|
|
135
|
+
Destination: {
|
|
136
|
+
ToAddresses: envelope.to
|
|
137
|
+
}
|
|
236
138
|
};
|
|
237
139
|
|
|
238
140
|
Object.keys(mail.data.ses || {}).forEach(key => {
|
|
239
141
|
sesMessage[key] = mail.data.ses[key];
|
|
240
142
|
});
|
|
241
143
|
|
|
242
|
-
|
|
243
|
-
let aws = this.ses.aws || {};
|
|
244
|
-
|
|
245
|
-
let getRegion = cb => {
|
|
246
|
-
if (ses.config && typeof ses.config.region === 'function') {
|
|
247
|
-
// promise
|
|
248
|
-
return ses.config
|
|
249
|
-
.region()
|
|
250
|
-
.then(region => cb(null, region))
|
|
251
|
-
.catch(err => cb(err));
|
|
252
|
-
}
|
|
253
|
-
return cb(null, (ses.config && ses.config.region) || 'us-east-1');
|
|
254
|
-
};
|
|
255
|
-
|
|
256
|
-
getRegion((err, region) => {
|
|
144
|
+
this.getRegion((err, region) => {
|
|
257
145
|
if (err || !region) {
|
|
258
146
|
region = 'us-east-1';
|
|
259
147
|
}
|
|
260
148
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
// v3 API
|
|
264
|
-
sendPromise = ses.send(new aws.SendRawEmailCommand(sesMessage));
|
|
265
|
-
} else {
|
|
266
|
-
// v2 API
|
|
267
|
-
sendPromise = ses.sendRawEmail(sesMessage).promise();
|
|
268
|
-
}
|
|
149
|
+
const command = new this.ses.SendEmailCommand(sesMessage);
|
|
150
|
+
const sendPromise = this.ses.sesClient.send(command);
|
|
269
151
|
|
|
270
152
|
sendPromise
|
|
271
153
|
.then(data => {
|
|
@@ -273,7 +155,7 @@ class SESTransport extends EventEmitter {
|
|
|
273
155
|
region = 'email';
|
|
274
156
|
}
|
|
275
157
|
|
|
276
|
-
statObject.pending =
|
|
158
|
+
statObject.pending = true;
|
|
277
159
|
callback(null, {
|
|
278
160
|
envelope: {
|
|
279
161
|
from: envelope.from,
|
|
@@ -309,38 +191,41 @@ class SESTransport extends EventEmitter {
|
|
|
309
191
|
*/
|
|
310
192
|
verify(callback) {
|
|
311
193
|
let promise;
|
|
312
|
-
let ses = (this.ses.aws ? this.ses.ses : this.ses) || {};
|
|
313
|
-
let aws = this.ses.aws || {};
|
|
314
|
-
|
|
315
|
-
const sesMessage = {
|
|
316
|
-
RawMessage: {
|
|
317
|
-
// required
|
|
318
|
-
Data: 'From: invalid@invalid\r\nTo: invalid@invalid\r\n Subject: Invalid\r\n\r\nInvalid'
|
|
319
|
-
},
|
|
320
|
-
Source: 'invalid@invalid',
|
|
321
|
-
Destinations: ['invalid@invalid']
|
|
322
|
-
};
|
|
323
|
-
|
|
324
194
|
if (!callback) {
|
|
325
195
|
promise = new Promise((resolve, reject) => {
|
|
326
196
|
callback = shared.callbackPromise(resolve, reject);
|
|
327
197
|
});
|
|
328
198
|
}
|
|
199
|
+
|
|
329
200
|
const cb = err => {
|
|
330
|
-
if (err && (err.code || err.Code
|
|
201
|
+
if (err && !['InvalidParameterValue', 'MessageRejected'].includes(err.code || err.Code || err.name)) {
|
|
331
202
|
return callback(err);
|
|
332
203
|
}
|
|
333
204
|
return callback(null, true);
|
|
334
205
|
};
|
|
335
206
|
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
207
|
+
const sesMessage = {
|
|
208
|
+
Content: {
|
|
209
|
+
Raw: {
|
|
210
|
+
Data: Buffer.from('From: <invalid@invalid>\r\nTo: <invalid@invalid>\r\n Subject: Invalid\r\n\r\nInvalid')
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
FromEmailAddress: 'invalid@invalid',
|
|
214
|
+
Destination: {
|
|
215
|
+
ToAddresses: ['invalid@invalid']
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
this.getRegion((err, region) => {
|
|
220
|
+
if (err || !region) {
|
|
221
|
+
region = 'us-east-1';
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
const command = new this.ses.SendEmailCommand(sesMessage);
|
|
225
|
+
const sendPromise = this.ses.sesClient.send(command);
|
|
226
|
+
|
|
227
|
+
sendPromise.then(data => cb(null, data)).catch(err => cb(err));
|
|
228
|
+
});
|
|
344
229
|
|
|
345
230
|
return promise;
|
|
346
231
|
}
|
|
@@ -243,6 +243,8 @@ class SMTPConnection extends EventEmitter {
|
|
|
243
243
|
if (this.options.connection) {
|
|
244
244
|
// connection is already opened
|
|
245
245
|
this._socket = this.options.connection;
|
|
246
|
+
setupConnectionHandlers();
|
|
247
|
+
|
|
246
248
|
if (this.secureConnection && !this.alreadySecured) {
|
|
247
249
|
setImmediate(() =>
|
|
248
250
|
this._upgradeConnection(err => {
|
|
@@ -412,7 +414,7 @@ class SMTPConnection extends EventEmitter {
|
|
|
412
414
|
|
|
413
415
|
if (socket && !socket.destroyed) {
|
|
414
416
|
try {
|
|
415
|
-
|
|
417
|
+
socket[closeMethod]();
|
|
416
418
|
} catch (E) {
|
|
417
419
|
// just ignore
|
|
418
420
|
}
|
|
@@ -636,7 +638,7 @@ class SMTPConnection extends EventEmitter {
|
|
|
636
638
|
stream.write(message);
|
|
637
639
|
stream.end();
|
|
638
640
|
}
|
|
639
|
-
|
|
641
|
+
|
|
640
642
|
return callback(err);
|
|
641
643
|
}
|
|
642
644
|
let envelopeTime = Date.now();
|
|
@@ -203,6 +203,14 @@
|
|
|
203
203
|
"port": 2525
|
|
204
204
|
},
|
|
205
205
|
|
|
206
|
+
"Proton": {
|
|
207
|
+
"aliases": ["ProtonMail", "Proton.me", "Protonmail.com", "Protonmail.ch"],
|
|
208
|
+
"domains": ["proton.me", "protonmail.com", "pm.me", "protonmail.ch"],
|
|
209
|
+
"host": "smtp.protonmail.ch",
|
|
210
|
+
"port": 587,
|
|
211
|
+
"requireTLS": true
|
|
212
|
+
},
|
|
213
|
+
|
|
206
214
|
"qiye.aliyun": {
|
|
207
215
|
"host": "smtp.mxhichina.com",
|
|
208
216
|
"port": "465",
|
|
@@ -306,6 +314,14 @@
|
|
|
306
314
|
"secure": true
|
|
307
315
|
},
|
|
308
316
|
|
|
317
|
+
"Seznam": {
|
|
318
|
+
"aliases": ["Seznam Email"],
|
|
319
|
+
"domains": ["seznam.cz", "email.cz", "post.cz", "spoluzaci.cz"],
|
|
320
|
+
"host": "smtp.seznam.cz",
|
|
321
|
+
"port": 465,
|
|
322
|
+
"secure": true
|
|
323
|
+
},
|
|
324
|
+
|
|
309
325
|
"Sparkpost": {
|
|
310
326
|
"aliases": ["SparkPost", "SparkPost Mail"],
|
|
311
327
|
"domains": ["sparkpost.com"],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nodemailer",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.3",
|
|
4
4
|
"description": "Easy as cake e-mail sending from your Node.js applications",
|
|
5
5
|
"main": "lib/nodemailer.js",
|
|
6
6
|
"scripts": {
|
|
@@ -23,15 +23,15 @@
|
|
|
23
23
|
},
|
|
24
24
|
"homepage": "https://nodemailer.com/",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@aws-sdk/client-
|
|
26
|
+
"@aws-sdk/client-sesv2": "3.804.0",
|
|
27
27
|
"bunyan": "1.8.15",
|
|
28
|
-
"c8": "10.1.
|
|
28
|
+
"c8": "10.1.3",
|
|
29
29
|
"eslint": "8.57.0",
|
|
30
30
|
"eslint-config-nodemailer": "1.2.0",
|
|
31
31
|
"eslint-config-prettier": "9.1.0",
|
|
32
32
|
"libbase64": "1.3.0",
|
|
33
|
-
"libmime": "5.3.
|
|
34
|
-
"libqp": "2.1.
|
|
33
|
+
"libmime": "5.3.6",
|
|
34
|
+
"libqp": "2.1.1",
|
|
35
35
|
"nodemailer-ntlm-auth": "1.0.4",
|
|
36
36
|
"proxy": "1.0.2",
|
|
37
37
|
"proxy-test-server": "1.0.0",
|
|
@@ -118,7 +118,6 @@
|
|
|
118
118
|
"beats",
|
|
119
119
|
"beauty",
|
|
120
120
|
"beer",
|
|
121
|
-
"bentley",
|
|
122
121
|
"berlin",
|
|
123
122
|
"best",
|
|
124
123
|
"bestbuy",
|
|
@@ -627,7 +626,6 @@
|
|
|
627
626
|
"kddi",
|
|
628
627
|
"ke",
|
|
629
628
|
"kerryhotels",
|
|
630
|
-
"kerrylogistics",
|
|
631
629
|
"kerryproperties",
|
|
632
630
|
"kfh",
|
|
633
631
|
"kg",
|
|
@@ -659,7 +657,6 @@
|
|
|
659
657
|
"lacaixa",
|
|
660
658
|
"lamborghini",
|
|
661
659
|
"lamer",
|
|
662
|
-
"lancaster",
|
|
663
660
|
"land",
|
|
664
661
|
"landrover",
|
|
665
662
|
"lanxess",
|
|
@@ -691,7 +688,6 @@
|
|
|
691
688
|
"limo",
|
|
692
689
|
"lincoln",
|
|
693
690
|
"link",
|
|
694
|
-
"lipsy",
|
|
695
691
|
"live",
|
|
696
692
|
"living",
|
|
697
693
|
"lk",
|
|
@@ -916,7 +912,6 @@
|
|
|
916
912
|
"porn",
|
|
917
913
|
"post",
|
|
918
914
|
"pr",
|
|
919
|
-
"pramerica",
|
|
920
915
|
"praxi",
|
|
921
916
|
"press",
|
|
922
917
|
"prime",
|