nodemailer 10.1.6 → 10.1.7

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,12 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## [10.1.7](https://github.com/nodemailer/nodemailer/compare/v10.1.6...v10.1.7) (2026-10-18)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **mime-funcs:** encode parameter values that look like encoded words ([651d79b](https://github.com/nodemailer/nodemailer/commit/651d79b0e1067b93b0ae8fc1afbdf383a46c214d))
9
+
3
10
  ## [10.1.6](https://github.com/nodemailer/nodemailer/compare/v10.1.5...v10.1.6) (2026-10-18)
4
11
 
5
12
 
@@ -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 [
@@ -1,3 +1,3 @@
1
1
  export declare const name = "nodemailer";
2
- export declare const version = "10.1.6";
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.6';
6
+ exports.version = '10.1.7';
7
7
  exports.homepage = 'https://nodemailer.com/';
@@ -21,6 +21,12 @@ export function isPlainText(value, isParam) {
21
21
  const re = isParam ? /[\x00-\x1f\x7f"\u0080-\uFFFF]/ : /[\x00-\x08\x0b\x0c\x0e-\x1f\u0080-\uFFFF]/;
22
22
  return typeof value === 'string' && !re.test(value);
23
23
  }
24
+ // A parameter value goes out as is only when it is plain text that does not look like an encoded
25
+ // word. Receivers decode encoded words found in parameter values (libmime does so for unencoded
26
+ // continuations), so as plain text it would come back as something else
27
+ function isPlainParamValue(value) {
28
+ return isPlainText(value, true) && !value.includes('=?');
29
+ }
24
30
  /**
25
31
  * Wraps a value into a quoted-string. Inside one a quote would end the string early
26
32
  * and a backslash would escape whatever follows it, so both go out as quoted-pairs.
@@ -188,7 +194,7 @@ export function buildHeaderValue(structured) {
188
194
  const value = structured.params[key];
189
195
  // a parameter name is a token too and it is emitted without any quoting around it
190
196
  const param = key.replace(/[\x00-\x1f\x7f]/g, '');
191
- if (!isPlainText(value, true) || value.length >= 75) {
197
+ if (!isPlainParamValue(value) || value.length >= 75) {
192
198
  buildHeaderParam(param, value, 50).forEach(encodedParam => {
193
199
  if (!/[\s"\\;:/=(),<>@[\]?]|^[-']|'$/.test(encodedParam.value) || encodedParam.key.substr(-1) === '*') {
194
200
  paramsArray.push(encodedParam.key + '=' + encodedParam.value);
@@ -237,7 +243,7 @@ export function buildHeaderParam(key, data, maxLength) {
237
243
  let i, len;
238
244
  maxLength = maxLength || 50;
239
245
  // process ascii only text
240
- if (isPlainText(data, true)) {
246
+ if (isPlainParamValue(data)) {
241
247
  // check if conversion is even needed
242
248
  if (encodedStr.length <= maxLength) {
243
249
  return [
@@ -1,3 +1,3 @@
1
1
  export declare const name = "nodemailer";
2
- export declare const version = "10.1.6";
2
+ export declare const version = "10.1.7";
3
3
  export declare const homepage = "https://nodemailer.com/";
@@ -1,4 +1,4 @@
1
1
  // Generated by scripts/build.js from package.json. Do not edit by hand.
2
2
  export const name = 'nodemailer';
3
- export const version = '10.1.6';
3
+ export const version = '10.1.7';
4
4
  export const homepage = 'https://nodemailer.com/';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodemailer",
3
- "version": "10.1.6",
3
+ "version": "10.1.7",
4
4
  "description": "Easy as cake e-mail sending from your Node.js applications",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/nodemailer.js",