nodemailer 6.4.18 → 6.5.0
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/CHANGELOG.md +6 -0
- package/lib/mail-composer/index.js +1 -0
- package/lib/mime-node/index.js +1 -1
- package/lib/ses-transport/index.js +54 -26
- package/package.json +4 -5
package/CHANGELOG.md
CHANGED
|
@@ -475,6 +475,7 @@ class MailComposer {
|
|
|
475
475
|
} else {
|
|
476
476
|
node = parentNode.createChild(element.contentType, {
|
|
477
477
|
filename: element.filename,
|
|
478
|
+
textEncoding: this.mail.textEncoding,
|
|
478
479
|
disableUrlAccess: this.mail.disableUrlAccess,
|
|
479
480
|
disableFileAccess: this.mail.disableFileAccess,
|
|
480
481
|
normalizeHeaderKey: this.mail.normalizeHeaderKey
|
package/lib/mime-node/index.js
CHANGED
|
@@ -451,7 +451,7 @@ class MimeNode {
|
|
|
451
451
|
transferEncoding = this._getTextEncoding(this.content) === 'Q' ? 'quoted-printable' : 'base64';
|
|
452
452
|
} else {
|
|
453
453
|
// we can not check content for a stream, so either use preferred encoding or fallback to QP
|
|
454
|
-
transferEncoding = this.
|
|
454
|
+
transferEncoding = this.textEncoding === 'B' ? 'base64' : 'quoted-printable';
|
|
455
455
|
}
|
|
456
456
|
} else if (!/^(multipart|message)\//i.test(contentType)) {
|
|
457
457
|
transferEncoding = transferEncoding || 'base64';
|
|
@@ -239,36 +239,64 @@ class SESTransport extends EventEmitter {
|
|
|
239
239
|
sesMessage[key] = mail.data.ses[key];
|
|
240
240
|
});
|
|
241
241
|
|
|
242
|
-
this.ses.
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
err
|
|
252
|
-
);
|
|
253
|
-
statObject.pending = false;
|
|
254
|
-
return callback(err);
|
|
242
|
+
let ses = (this.ses.aws ? this.ses.ses : this.ses) || {};
|
|
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));
|
|
255
252
|
}
|
|
253
|
+
return cb(null, (ses.config && ses.config.region) || 'us-east-1');
|
|
254
|
+
};
|
|
256
255
|
|
|
257
|
-
|
|
258
|
-
if (
|
|
259
|
-
region = '
|
|
256
|
+
getRegion((err, region) => {
|
|
257
|
+
if (err || !region) {
|
|
258
|
+
region = 'us-east-1';
|
|
260
259
|
}
|
|
261
260
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
261
|
+
let sendPromise;
|
|
262
|
+
if (typeof ses.send === 'function' && aws.SendRawEmailCommand) {
|
|
263
|
+
// v3 API
|
|
264
|
+
sendPromise = ses.send(new aws.SendRawEmailCommand(sesMessage));
|
|
265
|
+
} else {
|
|
266
|
+
// v2 API
|
|
267
|
+
sendPromise = ses.sendRawEmail(sesMessage).promise();
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
sendPromise
|
|
271
|
+
.then(data => {
|
|
272
|
+
if (region === 'us-east-1') {
|
|
273
|
+
region = 'email';
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
statObject.pending = false;
|
|
277
|
+
callback(null, {
|
|
278
|
+
envelope: {
|
|
279
|
+
from: envelope.from,
|
|
280
|
+
to: envelope.to
|
|
281
|
+
},
|
|
282
|
+
messageId: '<' + data.MessageId + (!/@/.test(data.MessageId) ? '@' + region + '.amazonses.com' : '') + '>',
|
|
283
|
+
response: data.MessageId,
|
|
284
|
+
raw
|
|
285
|
+
});
|
|
286
|
+
})
|
|
287
|
+
.catch(err => {
|
|
288
|
+
this.logger.error(
|
|
289
|
+
{
|
|
290
|
+
err,
|
|
291
|
+
tnx: 'send'
|
|
292
|
+
},
|
|
293
|
+
'Send error for %s: %s',
|
|
294
|
+
messageId,
|
|
295
|
+
err.message
|
|
296
|
+
);
|
|
297
|
+
statObject.pending = false;
|
|
298
|
+
callback(err);
|
|
299
|
+
});
|
|
272
300
|
});
|
|
273
301
|
})
|
|
274
302
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nodemailer",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.5.0",
|
|
4
4
|
"description": "Easy as cake e-mail sending from your Node.js applications",
|
|
5
5
|
"main": "lib/nodemailer.js",
|
|
6
6
|
"scripts": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"bunyan": "1.8.15",
|
|
24
24
|
"chai": "4.3.0",
|
|
25
25
|
"eslint-config-nodemailer": "1.2.0",
|
|
26
|
-
"eslint-config-prettier": "
|
|
26
|
+
"eslint-config-prettier": "8.1.0",
|
|
27
27
|
"grunt": "1.3.0",
|
|
28
28
|
"grunt-cli": "1.3.2",
|
|
29
29
|
"grunt-eslint": "23.0.0",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"libbase64": "1.2.1",
|
|
32
32
|
"libmime": "5.0.0",
|
|
33
33
|
"libqp": "1.1.0",
|
|
34
|
-
"mocha": "8.
|
|
34
|
+
"mocha": "8.3.0",
|
|
35
35
|
"nodemailer-ntlm-auth": "1.0.1",
|
|
36
36
|
"proxy": "1.0.2",
|
|
37
37
|
"proxy-test-server": "1.0.0",
|
|
@@ -40,6 +40,5 @@
|
|
|
40
40
|
},
|
|
41
41
|
"engines": {
|
|
42
42
|
"node": ">=6.0.0"
|
|
43
|
-
}
|
|
44
|
-
"dependencies": {}
|
|
43
|
+
}
|
|
45
44
|
}
|