nodemailer 7.0.2 → 7.0.4

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,21 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## [7.0.4](https://github.com/nodemailer/nodemailer/compare/v7.0.3...v7.0.4) (2025-06-29)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **pools:** Emit 'clear' once transporter is idle and all connections are closed ([839e286](https://github.com/nodemailer/nodemailer/commit/839e28634c9a93ae4321f399a8c893bf487a09fa))
9
+ * **smtp-connection:** jsdoc public annotation for socket ([#1741](https://github.com/nodemailer/nodemailer/issues/1741)) ([c45c84f](https://github.com/nodemailer/nodemailer/commit/c45c84fe9b8e2ec5e0615ab02d4197473911ab3e))
10
+ * **well-known-services:** Added AliyunQiye ([bb9e6da](https://github.com/nodemailer/nodemailer/commit/bb9e6daffb632d7d8f969359859f88a138de3a48))
11
+
12
+ ## [7.0.3](https://github.com/nodemailer/nodemailer/compare/v7.0.2...v7.0.3) (2025-05-08)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * **attachments:** Set the default transfer encoding for message/rfc822 attachments as '7bit' ([007d5f3](https://github.com/nodemailer/nodemailer/commit/007d5f3f40908c588f1db46c76de8b64ff429327))
18
+
3
19
  ## [7.0.2](https://github.com/nodemailer/nodemailer/compare/v7.0.1...v7.0.2) (2025-05-04)
4
20
 
5
21
 
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) {
@@ -87,6 +87,11 @@ class Mail extends EventEmitter {
87
87
  this.transporter.on('idle', (...args) => {
88
88
  this.emit('idle', ...args);
89
89
  });
90
+
91
+ // indicates if the sender has became idle and all connections are terminated
92
+ this.transporter.on('clear', (...args) => {
93
+ this.emit('clear', ...args);
94
+ });
90
95
  }
91
96
 
92
97
  /**
@@ -124,7 +124,7 @@ class SMTPConnection extends EventEmitter {
124
124
 
125
125
  /**
126
126
  * The socket connecting to the server
127
- * @publick
127
+ * @public
128
128
  */
129
129
  this._socket = false;
130
130
 
@@ -406,6 +406,10 @@ class SMTPPool extends EventEmitter {
406
406
  this._continueProcessing();
407
407
  }, 50);
408
408
  } else {
409
+ if (!this._closed && this.idling && !this._connections.length) {
410
+ this.emit('clear');
411
+ }
412
+
409
413
  this._continueProcessing();
410
414
  }
411
415
  });
@@ -5,14 +5,20 @@
5
5
  "secure": true,
6
6
  "authMethod": "LOGIN"
7
7
  },
8
-
8
+
9
9
  "Aliyun": {
10
10
  "domains": ["aliyun.com"],
11
11
  "host": "smtp.aliyun.com",
12
12
  "port": 465,
13
13
  "secure": true
14
14
  },
15
-
15
+
16
+ "AliyunQiye": {
17
+ "host": "smtp.qiye.aliyun.com",
18
+ "port": 465,
19
+ "secure": true
20
+ },
21
+
16
22
  "AOL": {
17
23
  "domains": ["aol.com"],
18
24
  "host": "smtp.aol.com",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodemailer",
3
- "version": "7.0.2",
3
+ "version": "7.0.4",
4
4
  "description": "Easy as cake e-mail sending from your Node.js applications",
5
5
  "main": "lib/nodemailer.js",
6
6
  "scripts": {
@@ -23,19 +23,19 @@
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.839.0",
27
27
  "bunyan": "1.8.15",
28
28
  "c8": "10.1.3",
29
29
  "eslint": "8.57.0",
30
30
  "eslint-config-nodemailer": "1.2.0",
31
31
  "eslint-config-prettier": "9.1.0",
32
32
  "libbase64": "1.3.0",
33
- "libmime": "5.3.6",
33
+ "libmime": "5.3.7",
34
34
  "libqp": "2.1.1",
35
35
  "nodemailer-ntlm-auth": "1.0.4",
36
36
  "proxy": "1.0.2",
37
37
  "proxy-test-server": "1.0.0",
38
- "smtp-server": "3.13.6"
38
+ "smtp-server": "3.14.0"
39
39
  },
40
40
  "engines": {
41
41
  "node": ">=6.0.0"