nodemailer 6.9.0 → 6.9.2

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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 6.9.2 2023-05-11
4
+
5
+ - Fix uncaught exception on invalid attachment content payload
6
+
7
+ ## 6.9.1 2023-01-27
8
+
9
+ - Fix base64 encoding for emoji bytes in encoded words
10
+
3
11
  ## 6.9.0 2023-01-12
4
12
 
5
13
  - Do not throw if failed to resolve IPv4 addresses
@@ -84,6 +84,12 @@ module.exports = {
84
84
  let lpart = '';
85
85
  for (let i = 0, len = encodedStr.length; i < len; i++) {
86
86
  let chr = encodedStr.charAt(i);
87
+
88
+ if (/[\ud83c\ud83d\ud83e]/.test(chr) && i < len - 1) {
89
+ // composite emoji byte, so add the next byte as well
90
+ chr += encodedStr.charAt(++i);
91
+ }
92
+
87
93
  // check if we can add this character to the existing string
88
94
  // without breaking byte length limit
89
95
  if (Buffer.byteLength(lpart + chr) <= maxLength || i === 0) {
@@ -950,7 +950,15 @@ class MimeNode {
950
950
  if (content._resolvedValue) {
951
951
  // pass string or buffer content as a stream
952
952
  contentStream = new PassThrough();
953
- setImmediate(() => contentStream.end(content._resolvedValue));
953
+
954
+ setImmediate(() => {
955
+ try {
956
+ contentStream.end(content._resolvedValue);
957
+ } catch (err) {
958
+ contentStream.emit('error', err);
959
+ }
960
+ });
961
+
954
962
  return contentStream;
955
963
  } else if (typeof content.pipe === 'function') {
956
964
  // assume as stream
@@ -974,7 +982,14 @@ class MimeNode {
974
982
  } else {
975
983
  // pass string or buffer content as a stream
976
984
  contentStream = new PassThrough();
977
- setImmediate(() => contentStream.end(content || ''));
985
+
986
+ setImmediate(() => {
987
+ try {
988
+ contentStream.end(content || '');
989
+ } catch (err) {
990
+ contentStream.emit('error', err);
991
+ }
992
+ });
978
993
  return contentStream;
979
994
  }
980
995
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodemailer",
3
- "version": "6.9.0",
3
+ "version": "6.9.2",
4
4
  "description": "Easy as cake e-mail sending from your Node.js applications",
5
5
  "main": "lib/nodemailer.js",
6
6
  "scripts": {
@@ -20,24 +20,24 @@
20
20
  },
21
21
  "homepage": "https://nodemailer.com/",
22
22
  "devDependencies": {
23
- "@aws-sdk/client-ses": "3.245.0",
24
- "aws-sdk": "2.1293.0",
23
+ "@aws-sdk/client-ses": "3.329.0",
24
+ "aws-sdk": "2.1376.0",
25
25
  "bunyan": "1.8.15",
26
26
  "chai": "4.3.7",
27
27
  "eslint-config-nodemailer": "1.2.0",
28
- "eslint-config-prettier": "8.6.0",
29
- "grunt": "1.5.3",
28
+ "eslint-config-prettier": "8.8.0",
29
+ "grunt": "1.6.1",
30
30
  "grunt-cli": "1.4.3",
31
- "grunt-eslint": "24.0.1",
31
+ "grunt-eslint": "24.1.0",
32
32
  "grunt-mocha-test": "0.13.3",
33
33
  "libbase64": "1.2.1",
34
- "libmime": "5.2.0",
34
+ "libmime": "5.2.1",
35
35
  "libqp": "2.0.1",
36
36
  "mocha": "10.2.0",
37
37
  "nodemailer-ntlm-auth": "1.0.3",
38
38
  "proxy": "1.0.2",
39
39
  "proxy-test-server": "1.0.0",
40
- "sinon": "15.0.1",
40
+ "sinon": "15.0.4",
41
41
  "smtp-server": "3.11.0"
42
42
  },
43
43
  "engines": {