nodemailer 7.0.2 → 7.0.3

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
+ ## [7.0.3](https://github.com/nodemailer/nodemailer/compare/v7.0.2...v7.0.3) (2025-05-08)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **attachments:** Set the default transfer encoding for message/rfc822 attachments as '7bit' ([007d5f3](https://github.com/nodemailer/nodemailer/commit/007d5f3f40908c588f1db46c76de8b64ff429327))
9
+
3
10
  ## [7.0.2](https://github.com/nodemailer/nodemailer/compare/v7.0.1...v7.0.2) (2025-05-04)
4
11
 
5
12
 
package/lib/dkim/index.js CHANGED
@@ -12,7 +12,7 @@ const path = require('path');
12
12
  const crypto = require('crypto');
13
13
 
14
14
  const DKIM_ALGO = 'sha256';
15
- const MAX_MESSAGE_SIZE = 128 * 1024; // buffer messages larger than this to disk
15
+ const MAX_MESSAGE_SIZE = 2 * 1024 * 1024; // buffer messages larger than this to disk
16
16
 
17
17
  /*
18
18
  // Usage:
@@ -86,20 +86,32 @@ class MailComposer {
86
86
  let icalEvent, eventObject;
87
87
  let attachments = [].concat(this.mail.attachments || []).map((attachment, i) => {
88
88
  let data;
89
- let isMessageNode = /^message\//i.test(attachment.contentType);
90
89
 
91
90
  if (/^data:/i.test(attachment.path || attachment.href)) {
92
91
  attachment = this._processDataUrl(attachment);
93
92
  }
94
93
 
95
94
  let contentType = attachment.contentType || mimeFuncs.detectMimeType(attachment.filename || attachment.path || attachment.href || 'bin');
95
+
96
96
  let isImage = /^image\//i.test(contentType);
97
+ let isMessageNode = /^message\//i.test(contentType);
98
+
97
99
  let contentDisposition = attachment.contentDisposition || (isMessageNode || (isImage && attachment.cid) ? 'inline' : 'attachment');
98
100
 
101
+ let contentTransferEncoding;
102
+ if ('contentTransferEncoding' in attachment) {
103
+ // also contains `false`, to set
104
+ contentTransferEncoding = attachment.contentTransferEncoding;
105
+ } else if (isMessageNode) {
106
+ contentTransferEncoding = '7bit';
107
+ } else {
108
+ contentTransferEncoding = 'base64'; // the default
109
+ }
110
+
99
111
  data = {
100
112
  contentType,
101
113
  contentDisposition,
102
- contentTransferEncoding: 'contentTransferEncoding' in attachment ? attachment.contentTransferEncoding : 'base64'
114
+ contentTransferEncoding
103
115
  };
104
116
 
105
117
  if (attachment.filename) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodemailer",
3
- "version": "7.0.2",
3
+ "version": "7.0.3",
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
  },
24
24
  "homepage": "https://nodemailer.com/",
25
25
  "devDependencies": {
26
- "@aws-sdk/client-sesv2": "3.800.0",
26
+ "@aws-sdk/client-sesv2": "3.804.0",
27
27
  "bunyan": "1.8.15",
28
28
  "c8": "10.1.3",
29
29
  "eslint": "8.57.0",