nodemailer 6.9.8 → 6.9.9
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/.ncurc.js +1 -3
- package/CHANGELOG.md +8 -0
- package/lib/mail-composer/index.js +1 -1
- package/lib/mailer/index.js +16 -14
- package/package.json +6 -9
package/.ncurc.js
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## [6.9.9](https://github.com/nodemailer/nodemailer/compare/v6.9.8...v6.9.9) (2024-02-01)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **security:** Fix issues described in GHSA-9h6g-pr28-7cqp. Do not use eternal matching pattern if only a few occurences are expected ([dd8f5e8](https://github.com/nodemailer/nodemailer/commit/dd8f5e8a4ddc99992e31df76bcff9c590035cd4a))
|
|
9
|
+
* **tests:** Use native node test runner, added code coverage support, removed grunt ([#1604](https://github.com/nodemailer/nodemailer/issues/1604)) ([be45c1b](https://github.com/nodemailer/nodemailer/commit/be45c1b299d012358d69247019391a02734d70af))
|
|
10
|
+
|
|
3
11
|
## [6.9.8](https://github.com/nodemailer/nodemailer/compare/v6.9.7...v6.9.8) (2023-12-30)
|
|
4
12
|
|
|
5
13
|
|
|
@@ -537,7 +537,7 @@ class MailComposer {
|
|
|
537
537
|
* @return {Object} Parsed element
|
|
538
538
|
*/
|
|
539
539
|
_processDataUrl(element) {
|
|
540
|
-
let parts = (element.path || element.href).match(/^data:((?:[^;]*;)
|
|
540
|
+
let parts = (element.path || element.href).match(/^data:((?:[^;]*;){0,20}(?:[^,]*)),(.*)$/i);
|
|
541
541
|
if (!parts) {
|
|
542
542
|
return element;
|
|
543
543
|
}
|
package/lib/mailer/index.js
CHANGED
|
@@ -395,21 +395,23 @@ class Mail extends EventEmitter {
|
|
|
395
395
|
return callback(err);
|
|
396
396
|
}
|
|
397
397
|
let cidCounter = 0;
|
|
398
|
-
html = (html || '')
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
398
|
+
html = (html || '')
|
|
399
|
+
.toString()
|
|
400
|
+
.replace(/(<img\b[^<>]{0,1024} src\s{0,20}=[\s"']{0,20})(data:([^;]+);[^"'>\s]+)/gi, (match, prefix, dataUri, mimeType) => {
|
|
401
|
+
let cid = crypto.randomBytes(10).toString('hex') + '@localhost';
|
|
402
|
+
if (!mail.data.attachments) {
|
|
403
|
+
mail.data.attachments = [];
|
|
404
|
+
}
|
|
405
|
+
if (!Array.isArray(mail.data.attachments)) {
|
|
406
|
+
mail.data.attachments = [].concat(mail.data.attachments || []);
|
|
407
|
+
}
|
|
408
|
+
mail.data.attachments.push({
|
|
409
|
+
path: dataUri,
|
|
410
|
+
cid,
|
|
411
|
+
filename: 'image-' + ++cidCounter + '.' + mimeTypes.detectExtension(mimeType)
|
|
412
|
+
});
|
|
413
|
+
return prefix + 'cid:' + cid;
|
|
410
414
|
});
|
|
411
|
-
return prefix + 'cid:' + cid;
|
|
412
|
-
});
|
|
413
415
|
mail.data.html = html;
|
|
414
416
|
callback();
|
|
415
417
|
});
|
package/package.json
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nodemailer",
|
|
3
|
-
"version": "6.9.
|
|
3
|
+
"version": "6.9.9",
|
|
4
4
|
"description": "Easy as cake e-mail sending from your Node.js applications",
|
|
5
5
|
"main": "lib/nodemailer.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"test": "
|
|
7
|
+
"test": "node --test --test-concurrency=1 test/**/*.test.js test/**/*-test.js",
|
|
8
|
+
"test:coverage": "c8 node --test --test-concurrency=1 test/**/*.test.js test/**/*-test.js",
|
|
9
|
+
"lint": "eslint .",
|
|
8
10
|
"update": "rm -rf node_modules/ package-lock.json && ncu -u && npm install"
|
|
9
11
|
},
|
|
10
12
|
"repository": {
|
|
@@ -23,21 +25,16 @@
|
|
|
23
25
|
"devDependencies": {
|
|
24
26
|
"@aws-sdk/client-ses": "3.484.0",
|
|
25
27
|
"bunyan": "1.8.15",
|
|
26
|
-
"
|
|
28
|
+
"c8": "8.0.1",
|
|
29
|
+
"eslint": "8.56.0",
|
|
27
30
|
"eslint-config-nodemailer": "1.2.0",
|
|
28
31
|
"eslint-config-prettier": "9.1.0",
|
|
29
|
-
"grunt": "1.6.1",
|
|
30
|
-
"grunt-cli": "1.4.3",
|
|
31
|
-
"grunt-eslint": "24.3.0",
|
|
32
|
-
"grunt-mocha-test": "0.13.3",
|
|
33
32
|
"libbase64": "1.2.1",
|
|
34
33
|
"libmime": "5.2.1",
|
|
35
34
|
"libqp": "2.0.1",
|
|
36
|
-
"mocha": "10.2.0",
|
|
37
35
|
"nodemailer-ntlm-auth": "1.0.4",
|
|
38
36
|
"proxy": "1.0.2",
|
|
39
37
|
"proxy-test-server": "1.0.0",
|
|
40
|
-
"sinon": "17.0.1",
|
|
41
38
|
"smtp-server": "3.13.0"
|
|
42
39
|
},
|
|
43
40
|
"engines": {
|