@mavogel/awscdk-rootmail 0.1.24 → 0.1.25

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.
Files changed (96) hide show
  1. package/.jsii +3 -3
  2. package/lib/rootmail.js +1 -1
  3. package/lib/ses-receive.js +1 -1
  4. package/node_modules/@zone-eu/mailsplit/README.md +1 -1
  5. package/node_modules/@zone-eu/mailsplit/lib/headers.js +10 -4
  6. package/node_modules/@zone-eu/mailsplit/lib/message-splitter.js +5 -4
  7. package/node_modules/@zone-eu/mailsplit/lib/mime-node.d.ts +4 -1
  8. package/node_modules/@zone-eu/mailsplit/lib/mime-node.js +23 -2
  9. package/node_modules/@zone-eu/mailsplit/lib/types.d.ts +3 -1
  10. package/node_modules/@zone-eu/mailsplit/package.json +4 -4
  11. package/node_modules/libbase64/CHANGELOG.md +20 -0
  12. package/node_modules/libbase64/README.md +40 -13
  13. package/node_modules/libbase64/dist/cjs/libbase64.d.ts +80 -0
  14. package/node_modules/libbase64/dist/cjs/libbase64.js +310 -0
  15. package/node_modules/libbase64/dist/cjs/package.json +3 -0
  16. package/node_modules/libbase64/dist/esm/libbase64.d.ts +80 -0
  17. package/node_modules/libbase64/{lib → dist/esm}/libbase64.js +74 -117
  18. package/node_modules/libbase64/dist/esm/package.json +3 -0
  19. package/node_modules/libbase64/package.json +59 -13
  20. package/node_modules/libmime/CHANGELOG.md +31 -0
  21. package/node_modules/libmime/README.md +55 -26
  22. package/node_modules/libmime/SECURITY.md +152 -0
  23. package/node_modules/libmime/dist/cjs/charset.d.ts +43 -0
  24. package/node_modules/libmime/dist/cjs/charset.js +135 -0
  25. package/node_modules/libmime/dist/cjs/charsets.d.ts +2 -0
  26. package/node_modules/libmime/dist/cjs/charsets.js +213 -0
  27. package/node_modules/libmime/dist/cjs/get-charset-name.d.ts +1 -0
  28. package/node_modules/libmime/dist/cjs/get-charset-name.js +224 -0
  29. package/node_modules/libmime/dist/cjs/libmime.d.ts +218 -0
  30. package/node_modules/libmime/dist/cjs/libmime.js +1013 -0
  31. package/node_modules/libmime/dist/cjs/mimetypes.d.ts +7 -0
  32. package/node_modules/libmime/dist/cjs/mimetypes.js +2072 -0
  33. package/node_modules/libmime/dist/cjs/package.json +3 -0
  34. package/node_modules/libmime/dist/cjs/types.d.ts +59 -0
  35. package/node_modules/libmime/dist/cjs/types.js +4 -0
  36. package/node_modules/libmime/dist/esm/charset.d.ts +43 -0
  37. package/node_modules/libmime/dist/esm/charset.js +125 -0
  38. package/node_modules/libmime/dist/esm/charsets.d.ts +2 -0
  39. package/node_modules/libmime/{lib → dist/esm}/charsets.js +3 -5
  40. package/node_modules/libmime/dist/esm/get-charset-name.d.ts +1 -0
  41. package/node_modules/libmime/{lib → dist/esm}/get-charset-name.js +1 -8
  42. package/node_modules/libmime/dist/esm/libmime.d.ts +219 -0
  43. package/node_modules/libmime/{lib → dist/esm}/libmime.js +256 -329
  44. package/node_modules/libmime/dist/esm/mimetypes.d.ts +7 -0
  45. package/node_modules/libmime/dist/esm/mimetypes.js +2068 -0
  46. package/node_modules/libmime/dist/esm/package.json +3 -0
  47. package/node_modules/libmime/dist/esm/types.d.ts +59 -0
  48. package/node_modules/libmime/dist/esm/types.js +3 -0
  49. package/node_modules/libmime/package.json +58 -15
  50. package/node_modules/libqp/CHANGELOG.md +18 -0
  51. package/node_modules/libqp/README.md +50 -19
  52. package/node_modules/libqp/dist/cjs/libqp.d.ts +74 -0
  53. package/node_modules/libqp/dist/cjs/libqp.js +378 -0
  54. package/node_modules/libqp/dist/cjs/package.json +3 -0
  55. package/node_modules/libqp/dist/esm/libqp.d.ts +74 -0
  56. package/node_modules/libqp/dist/esm/libqp.js +369 -0
  57. package/node_modules/libqp/dist/esm/package.json +3 -0
  58. package/node_modules/libqp/lib/libqp.js +4 -383
  59. package/node_modules/libqp/lib/package.json +3 -0
  60. package/node_modules/libqp/package.json +62 -6
  61. package/node_modules/mailparser/.release-please-manifest.json +1 -1
  62. package/node_modules/mailparser/CHANGELOG.md +42 -0
  63. package/node_modules/mailparser/package.json +5 -5
  64. package/node_modules/nodemailer/CHANGELOG.md +44 -0
  65. package/node_modules/nodemailer/dist/cjs/addressparser/index.js +695 -267
  66. package/node_modules/nodemailer/dist/cjs/mailer/mail-message.js +4 -1
  67. package/node_modules/nodemailer/dist/cjs/mime-funcs/index.js +8 -2
  68. package/node_modules/nodemailer/dist/cjs/mime-node/index.js +48 -16
  69. package/node_modules/nodemailer/dist/cjs/package-info.d.ts +1 -1
  70. package/node_modules/nodemailer/dist/cjs/package-info.js +1 -1
  71. package/node_modules/nodemailer/dist/cjs/shared/url.js +22 -5
  72. package/node_modules/nodemailer/dist/esm/addressparser/index.js +695 -267
  73. package/node_modules/nodemailer/dist/esm/mailer/mail-message.js +4 -1
  74. package/node_modules/nodemailer/dist/esm/mime-funcs/index.js +8 -2
  75. package/node_modules/nodemailer/dist/esm/mime-node/index.js +48 -16
  76. package/node_modules/nodemailer/dist/esm/package-info.d.ts +1 -1
  77. package/node_modules/nodemailer/dist/esm/package-info.js +1 -1
  78. package/node_modules/nodemailer/dist/esm/shared/url.js +22 -5
  79. package/node_modules/nodemailer/package.json +1 -1
  80. package/package.json +2 -2
  81. package/node_modules/libbase64/.eslintrc +0 -11
  82. package/node_modules/libbase64/.github/FUNDING.yml +0 -4
  83. package/node_modules/libbase64/.github/VULNERABILITY_REPORT.yml +0 -75
  84. package/node_modules/libbase64/.github/workflows/release.yaml +0 -39
  85. package/node_modules/libbase64/.github/workflows/test.yml +0 -21
  86. package/node_modules/libbase64/.ncurc.js +0 -13
  87. package/node_modules/libbase64/.prettierrc.js +0 -8
  88. package/node_modules/libmime/lib/charset.js +0 -131
  89. package/node_modules/libmime/lib/mimetypes.js +0 -2049
  90. package/node_modules/libqp/.eslintrc +0 -15
  91. package/node_modules/libqp/.github/FUNDING.yml +0 -4
  92. package/node_modules/libqp/.github/VULNERABILITY_REPORT.yml +0 -75
  93. package/node_modules/libqp/.github/workflows/release.yaml +0 -39
  94. package/node_modules/libqp/.github/workflows/test.yml +0 -21
  95. package/node_modules/libqp/.prettierrc.js +0 -8
  96. package/node_modules/libqp/test/libqp-test.js +0 -366
@@ -183,7 +183,10 @@ class MailMessage {
183
183
  const values = [data.html, data.text, data.watchHtml, data.amp, data.raw, data.icalEvent];
184
184
  for (const key of ['attachments', 'alternatives']) {
185
185
  if (Array.isArray(data[key])) {
186
- values.push(...data[key]);
186
+ // one at a time, spreading a long enough list into the arguments throws
187
+ for (const entry of data[key]) {
188
+ values.push(entry);
189
+ }
187
190
  }
188
191
  }
189
192
  for (const value of values) {
@@ -70,6 +70,12 @@ function isPlainText(value, isParam) {
70
70
  const re = isParam ? /[\x00-\x1f\x7f"\u0080-\uFFFF]/ : /[\x00-\x08\x0b\x0c\x0e-\x1f\u0080-\uFFFF]/;
71
71
  return typeof value === 'string' && !re.test(value);
72
72
  }
73
+ // A parameter value goes out as is only when it is plain text that does not look like an encoded
74
+ // word. Receivers decode encoded words found in parameter values (libmime does so for unencoded
75
+ // continuations), so as plain text it would come back as something else
76
+ function isPlainParamValue(value) {
77
+ return isPlainText(value, true) && !value.includes('=?');
78
+ }
73
79
  /**
74
80
  * Wraps a value into a quoted-string. Inside one a quote would end the string early
75
81
  * and a backslash would escape whatever follows it, so both go out as quoted-pairs.
@@ -237,7 +243,7 @@ function buildHeaderValue(structured) {
237
243
  const value = structured.params[key];
238
244
  // a parameter name is a token too and it is emitted without any quoting around it
239
245
  const param = key.replace(/[\x00-\x1f\x7f]/g, '');
240
- if (!isPlainText(value, true) || value.length >= 75) {
246
+ if (!isPlainParamValue(value) || value.length >= 75) {
241
247
  buildHeaderParam(param, value, 50).forEach(encodedParam => {
242
248
  if (!/[\s"\\;:/=(),<>@[\]?]|^[-']|'$/.test(encodedParam.value) || encodedParam.key.substr(-1) === '*') {
243
249
  paramsArray.push(encodedParam.key + '=' + encodedParam.value);
@@ -286,7 +292,7 @@ function buildHeaderParam(key, data, maxLength) {
286
292
  let i, len;
287
293
  maxLength = maxLength || 50;
288
294
  // process ascii only text
289
- if (isPlainText(data, true)) {
295
+ if (isPlainParamValue(data)) {
290
296
  // check if conversion is even needed
291
297
  if (encodedStr.length <= maxLength) {
292
298
  return [
@@ -64,6 +64,35 @@ const QUOTED_STRING = /^"(?:[^"\\]|\\[\s\S])*"$/;
64
64
  // else goes into angle brackets so that the header can not be read as more addresses than
65
65
  // the envelope carries
66
66
  const PLAIN_ADDRESS = /^[^\s"(),:;<>@[\\\]]+@[^\s"(),:;<>@[\\\]]+$/;
67
+ /**
68
+ * A domain literal that ends an address, see _normalizeAddress
69
+ */
70
+ const DOMAIN_LITERAL_TAIL = /@(\[[^[\]\\]*\])$/;
71
+ /**
72
+ * Removes the whitespace inside every <...> of a References value. A "<" with no ">" after
73
+ * it is left as it is. An index scan, the regex /<[^>]*>/g rescans the rest of the value
74
+ * from every such "<"
75
+ *
76
+ * @param value References header value
77
+ * @returns The value with the msg-ids closed up
78
+ */
79
+ function stripWhitespaceInAngleBrackets(value) {
80
+ let result = '';
81
+ let pos = 0;
82
+ for (;;) {
83
+ const open = value.indexOf('<', pos);
84
+ if (open < 0) {
85
+ break;
86
+ }
87
+ const close = value.indexOf('>', open + 1);
88
+ if (close < 0) {
89
+ break;
90
+ }
91
+ result += value.slice(pos, open) + value.slice(open, close + 1).replace(/\s/g, '');
92
+ pos = close + 1;
93
+ }
94
+ return result + value.slice(pos);
95
+ }
67
96
  // domainToASCII and domainToUnicode are WHATWG host parsers rather than plain IDNA
68
97
  // mappers, so they do more than map: they cut the host at '/', '\\', '?' and '#', drop C0
69
98
  // controls, and percent-decode. Handing them 'evil.example/mail.corp.example' returns the
@@ -1357,26 +1386,26 @@ class MimeNode {
1357
1386
  }
1358
1387
  return value;
1359
1388
  // space separated list of values enclosed in <>
1360
- case 'References':
1361
- value = [].concat
1362
- .apply([], [].concat(value || '').map(elm => {
1363
- elm = (elm || '')
1389
+ case 'References': {
1390
+ const ids = [];
1391
+ for (const entry of [].concat(value || '')) {
1392
+ const elm = (entry || '')
1364
1393
  .toString()
1365
1394
  .replace(/\r?\n|\r/g, ' ')
1366
1395
  .replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g, '')
1367
1396
  .trim();
1368
- return elm.replace(/<[^>]*>/g, str => str.replace(/\s/g, '')).split(/\s+/);
1369
- }))
1370
- .map(elm => {
1371
- if (elm.charAt(0) !== '<') {
1372
- elm = '<' + elm;
1373
- }
1374
- if (elm.charAt(elm.length - 1) !== '>') {
1375
- elm = elm + '>';
1397
+ for (let id of stripWhitespaceInAngleBrackets(elm).split(/\s+/)) {
1398
+ if (id.charAt(0) !== '<') {
1399
+ id = '<' + id;
1400
+ }
1401
+ if (id.charAt(id.length - 1) !== '>') {
1402
+ id = id + '>';
1403
+ }
1404
+ ids.push(id);
1376
1405
  }
1377
- return elm;
1378
- });
1379
- return value.join(' ').trim();
1406
+ }
1407
+ return ids.join(' ').trim();
1408
+ }
1380
1409
  case 'Date':
1381
1410
  if (Object.prototype.toString.call(value) === '[object Date]') {
1382
1411
  return value.toUTCString().replace(/GMT/, '+0000');
@@ -1455,7 +1484,10 @@ class MimeNode {
1455
1484
  // callers use an empty value to detect a missing address
1456
1485
  return address;
1457
1486
  }
1458
- const lastAt = address.lastIndexOf('@');
1487
+ // dtext includes '@', so a domain literal is split off at the '@' in front of it and
1488
+ // not at the last one, which delivered 'a@[x@evil.com]' to evil.com
1489
+ const literal = address.charAt(address.length - 1) === ']' ? DOMAIN_LITERAL_TAIL.exec(address) : null;
1490
+ const lastAt = literal ? address.length - literal[1].length - 1 : address.lastIndexOf('@');
1459
1491
  if (lastAt < 0) {
1460
1492
  // Bare username, there is no domain to split off
1461
1493
  return this._normalizeLocalPart(address);
@@ -1,3 +1,3 @@
1
1
  export declare const name = "nodemailer";
2
- export declare const version = "10.1.2";
2
+ export declare const version = "10.1.7";
3
3
  export declare const homepage = "https://nodemailer.com/";
@@ -3,5 +3,5 @@
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.homepage = exports.version = exports.name = void 0;
5
5
  exports.name = 'nodemailer';
6
- exports.version = '10.1.2';
6
+ exports.version = '10.1.7';
7
7
  exports.homepage = 'https://nodemailer.com/';
@@ -58,10 +58,27 @@ const punycode = __importStar(require("../punycode/index.js"));
58
58
  // Matches a "scheme:" not followed by "//" (and with something after it), used
59
59
  // to re-insert the authority separator the legacy parser did not require.
60
60
  const SLASHLESS_AUTHORITY = /^([a-zA-Z][a-zA-Z0-9+.-]*:)(?!\/\/)([\s\S]+)$/;
61
- // Leading and trailing C0 controls and spaces, which the WHATWG parser strips before it
62
- // looks at the input. Stripped up front so that the slash-less form is recognized in a
63
- // value read from a file with a trailing newline as well.
64
- const SURROUNDING_WHITESPACE = /^[\x00-\x20]+|[\x00-\x20]+$/g;
61
+ /**
62
+ * Drops the leading and trailing C0 controls and spaces, which the WHATWG parser strips
63
+ * before it looks at the input. Stripped up front so that the slash-less form is recognized
64
+ * in a value read from a file with a trailing newline as well. An index scan, the regex
65
+ * /^[\x00-\x20]+|[\x00-\x20]+$/g retried a run of spaces inside the value from every
66
+ * position in it
67
+ *
68
+ * @param input URL string
69
+ * @returns The string without the surrounding controls and spaces
70
+ */
71
+ function stripSurroundingWhitespace(input) {
72
+ let start = 0;
73
+ let end = input.length;
74
+ while (start < end && input.charCodeAt(start) <= 0x20) {
75
+ start++;
76
+ }
77
+ while (end > start && input.charCodeAt(end - 1) <= 0x20) {
78
+ end--;
79
+ }
80
+ return input.slice(start, end);
81
+ }
65
82
  // Leading characters legacy url.parse() skips before it reads the scheme
66
83
  const LEGACY_TRIM = /^[\x00-\x20\u00a0\ufeff]+/;
67
84
  // The authority of a "scheme://authority/..." or a scheme-relative "//authority/..."
@@ -156,7 +173,7 @@ function normalizeHostname(raw, href) {
156
173
  return mapped;
157
174
  }
158
175
  const parse = (input, parseQueryString) => {
159
- input = (input || '').replace(SURROUNDING_WHITESPACE, '');
176
+ input = stripSurroundingWhitespace(input || '');
160
177
  // Legacy url.parse() parses a "user:pass@host:port" authority that follows
161
178
  // the scheme even without the "//" separator, for schemes outside its
162
179
  // built-in slashed-protocol list (smtp:/smtps:/socks:/...). The WHATWG