nodemailer 6.9.2 → 6.9.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/.ncurc.js ADDED
@@ -0,0 +1,7 @@
1
+ module.exports = {
2
+ upgrade: true,
3
+ reject: [
4
+ // API changes break existing tests
5
+ 'proxy'
6
+ ]
7
+ };
package/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 6.9.3 2023-05-29
4
+
5
+ - Specified license identifier (was defined as MIT, actual value MIT-0)
6
+ - If SMTP server disconnects with a message, process it and include as part of the response error
7
+
3
8
  ## 6.9.2 2023-05-11
4
9
 
5
10
  - Fix uncaught exception on invalid attachment content payload
package/README.md CHANGED
@@ -90,7 +90,7 @@ If you are having issues with Nodemailer, then the best way to find help would b
90
90
 
91
91
  ### License
92
92
 
93
- Nodemailer is licensed under the **MIT license**
93
+ Nodemailer is licensed under the **MIT No Attribution license**
94
94
 
95
95
  ---
96
96
 
@@ -817,6 +817,20 @@ class SMTPConnection extends EventEmitter {
817
817
  * @event
818
818
  */
819
819
  _onClose() {
820
+ let serverResponse = false;
821
+
822
+ if (this._remainder && this._remainder.trim()) {
823
+ if (this.options.debug || this.options.transactionLog) {
824
+ this.logger.debug(
825
+ {
826
+ tnx: 'server'
827
+ },
828
+ this._remainder.replace(/\r?\n$/, '')
829
+ );
830
+ }
831
+ this.lastServerResponse = serverResponse = this._remainder.trim();
832
+ }
833
+
820
834
  this.logger.info(
821
835
  {
822
836
  tnx: 'network'
@@ -825,9 +839,11 @@ class SMTPConnection extends EventEmitter {
825
839
  );
826
840
 
827
841
  if (this.upgrading && !this._destroyed) {
828
- return this._onError(new Error('Connection closed unexpectedly'), 'ETLS', false, 'CONN');
842
+ return this._onError(new Error('Connection closed unexpectedly'), 'ETLS', serverResponse, 'CONN');
829
843
  } else if (![this._actionGreeting, this.close].includes(this._responseActions[0]) && !this._destroyed) {
830
- return this._onError(new Error('Connection closed unexpectedly'), 'ECONNECTION', false, 'CONN');
844
+ return this._onError(new Error('Connection closed unexpectedly'), 'ECONNECTION', serverResponse, 'CONN');
845
+ } else if (/^[45]\d{2}\b/.test(serverResponse)) {
846
+ return this._onError(new Error('Connection closed unexpectedly'), 'ECONNECTION', serverResponse, 'CONN');
831
847
  }
832
848
 
833
849
  this._destroy();
@@ -944,14 +960,14 @@ class SMTPConnection extends EventEmitter {
944
960
 
945
961
  if (!str.trim()) {
946
962
  // skip unexpected empty lines
947
- setImmediate(() => this._processResponse(true));
963
+ setImmediate(() => this._processResponse());
948
964
  }
949
965
 
950
966
  let action = this._responseActions.shift();
951
967
 
952
968
  if (typeof action === 'function') {
953
969
  action.call(this, str);
954
- setImmediate(() => this._processResponse(true));
970
+ setImmediate(() => this._processResponse());
955
971
  } else {
956
972
  return this._onError(new Error('Unexpected Response'), 'EPROTOCOL', str, 'CONN');
957
973
  }
@@ -42,6 +42,14 @@
42
42
  "secure": true
43
43
  },
44
44
 
45
+ "Forward Email": {
46
+ "aliases": ["FE", "ForwardEmail"],
47
+ "domains": ["forwardemail.net"],
48
+ "host": "smtp.forwardemail.net",
49
+ "port": 465,
50
+ "secure": true
51
+ },
52
+
45
53
  "GandiMail": {
46
54
  "aliases": ["Gandi", "Gandi Mail"],
47
55
  "host": "mail.gandi.net",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodemailer",
3
- "version": "6.9.2",
3
+ "version": "6.9.3",
4
4
  "description": "Easy as cake e-mail sending from your Node.js applications",
5
5
  "main": "lib/nodemailer.js",
6
6
  "scripts": {
@@ -14,14 +14,14 @@
14
14
  "Nodemailer"
15
15
  ],
16
16
  "author": "Andris Reinman",
17
- "license": "MIT",
17
+ "license": "MIT-0",
18
18
  "bugs": {
19
19
  "url": "https://github.com/nodemailer/nodemailer/issues"
20
20
  },
21
21
  "homepage": "https://nodemailer.com/",
22
22
  "devDependencies": {
23
- "@aws-sdk/client-ses": "3.329.0",
24
- "aws-sdk": "2.1376.0",
23
+ "@aws-sdk/client-ses": "3.341.0",
24
+ "aws-sdk": "2.1386.0",
25
25
  "bunyan": "1.8.15",
26
26
  "chai": "4.3.7",
27
27
  "eslint-config-nodemailer": "1.2.0",
@@ -37,8 +37,8 @@
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.4",
41
- "smtp-server": "3.11.0"
40
+ "sinon": "15.1.0",
41
+ "smtp-server": "3.12.0"
42
42
  },
43
43
  "engines": {
44
44
  "node": ">=6.0.0"