test-smtp-server 0.9.0 → 0.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/README.md +9 -6
- package/build/lib/test-smtp-server.js +1 -1
- package/package.json +10 -11
package/README.md
CHANGED
|
@@ -20,7 +20,8 @@ npm install test-smtp-server --save-dev
|
|
|
20
20
|
|
|
21
21
|
### Usage
|
|
22
22
|
|
|
23
|
-
See [test code](
|
|
23
|
+
See [test code](
|
|
24
|
+
https://github.com/webstech/test-smtp-server/blob/main/test/index.ts) for an example.
|
|
24
25
|
|
|
25
26
|
```js
|
|
26
27
|
import { testSmtpServer } from "test-smtp-server";
|
|
@@ -59,12 +60,14 @@ import { testSmtpServer } from "test-smtp-server";
|
|
|
59
60
|
|
|
60
61
|
### Security
|
|
61
62
|
|
|
62
|
-
The server is started as secure but that may not be
|
|
63
|
+
The server is started as secure but that may not be possible in the testing
|
|
63
64
|
environment. If the server does not have a valid certificate, the connection
|
|
64
|
-
will fail from the client side. Some clients
|
|
65
|
-
allow connections to non-secure
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
will fail from the client side. Some clients
|
|
66
|
+
(e.g. nodemailer/SMTP-Transport options) allow connections to non-secure
|
|
67
|
+
servers. Node allows connections through an
|
|
68
|
+
environment variable that turns off certificate authorization checking. See
|
|
69
|
+
[node_tls_reject_unauthorizedvalue](
|
|
70
|
+
https://nodejs.org/api/cli.html#node_tls_reject_unauthorizedvalue)
|
|
68
71
|
for more information. This may be insecure if other ports are used.
|
|
69
72
|
|
|
70
73
|
## License
|
|
@@ -64,7 +64,7 @@ class testSmtpServer {
|
|
|
64
64
|
this.server = new smtp_server_1.SMTPServer({
|
|
65
65
|
authOptional: true,
|
|
66
66
|
onConnect(session, callback) {
|
|
67
|
-
if (session.remoteAddress
|
|
67
|
+
if (!session.remoteAddress.match(/^127.0.0.1|::1$/)) {
|
|
68
68
|
return callback(new Error("Only connections from localhost allowed"));
|
|
69
69
|
}
|
|
70
70
|
return callback(); // Accept the connection
|
package/package.json
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "test-smtp-server",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.3",
|
|
4
4
|
"description": "The test-smtp-server package allows internal testing of projects needing an SMTP server.",
|
|
5
5
|
"main": "./build/lib/test-smtp-server.js",
|
|
6
|
-
"xtype": "module",
|
|
7
6
|
"types": "./build/lib/test-smtp-server.d.ts",
|
|
8
7
|
"directories": {
|
|
9
8
|
"lib": "lib",
|
|
@@ -47,19 +46,19 @@
|
|
|
47
46
|
"devDependencies": {
|
|
48
47
|
"@types/nodemailer": "^6.4.4",
|
|
49
48
|
"@types/smtp-server": "^3.5.7",
|
|
50
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
51
|
-
"@typescript-eslint/parser": "^5.
|
|
52
|
-
"commander": "^
|
|
49
|
+
"@typescript-eslint/eslint-plugin": "^5.26.0",
|
|
50
|
+
"@typescript-eslint/parser": "^5.26.0",
|
|
51
|
+
"commander": "^9.0.0",
|
|
53
52
|
"eslint": "^8.2.0",
|
|
54
|
-
"eslint-config-prettier": "^8.
|
|
55
|
-
"eslint-plugin-jsdoc": "^
|
|
56
|
-
"nodemailer": "^6.7.
|
|
57
|
-
"typescript": "^4.
|
|
53
|
+
"eslint-config-prettier": "^8.5.0",
|
|
54
|
+
"eslint-plugin-jsdoc": "^39.3.2",
|
|
55
|
+
"nodemailer": "^6.7.5",
|
|
56
|
+
"typescript": "^4.7.2"
|
|
58
57
|
},
|
|
59
58
|
"dependencies": {
|
|
60
59
|
"@types/mailparser": "^3.4.0",
|
|
61
|
-
"mailparser": "^3.
|
|
62
|
-
"smtp-server": "^3.
|
|
60
|
+
"mailparser": "^3.5.0",
|
|
61
|
+
"smtp-server": "^3.11.0"
|
|
63
62
|
},
|
|
64
63
|
"engines": {
|
|
65
64
|
"node": ">= 16.0.0"
|