test-smtp-server
Advanced tools
Comparing version 0.9.3 to 0.9.4
@@ -29,2 +29,4 @@ /// <reference types="node" /> | ||
smtpPort?: number; | ||
/** restrict ip addresses to localhost */ | ||
localhostOnly?: boolean; | ||
/** logging function like console.log() */ | ||
@@ -42,2 +44,3 @@ debug?: (message?: unknown, ...optionalParams: any[]) => void; | ||
private isDebugging; | ||
private localhostOnly; | ||
private port; | ||
@@ -44,0 +47,0 @@ private server; |
@@ -53,2 +53,3 @@ "use strict"; | ||
this.isDebugging = false; | ||
this.localhostOnly = true; | ||
this.port = 1025; | ||
@@ -59,2 +60,5 @@ if (options) { | ||
} | ||
if (options.localhostOnly) { | ||
this.localhostOnly = options.localhostOnly; | ||
} | ||
if (options.debug) { | ||
@@ -69,3 +73,4 @@ this.debug = options.debug; | ||
onConnect(session, callback) { | ||
if (!session.remoteAddress.match(/^127.0.0.1|::1$/)) { | ||
// 172.17 prefix is a linux docker container | ||
if (that.localhostOnly && !session.remoteAddress.match(/^172.17|127.0.0.1|::1$/)) { | ||
return callback(new Error("Only connections from localhost allowed")); | ||
@@ -72,0 +77,0 @@ } |
{ | ||
"name": "test-smtp-server", | ||
"version": "0.9.3", | ||
"version": "0.9.4", | ||
"description": "The test-smtp-server package allows internal testing of projects needing an SMTP server.", | ||
@@ -49,10 +49,10 @@ "main": "./build/lib/test-smtp-server.js", | ||
"@types/smtp-server": "^3.5.7", | ||
"@typescript-eslint/eslint-plugin": "^5.26.0", | ||
"@typescript-eslint/parser": "^5.26.0", | ||
"commander": "^9.0.0", | ||
"eslint": "^8.2.0", | ||
"@typescript-eslint/eslint-plugin": "^5.29.0", | ||
"@typescript-eslint/parser": "^5.29.0", | ||
"commander": "^9.3.0", | ||
"eslint": "^8.18.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-plugin-jsdoc": "^39.3.2", | ||
"eslint-plugin-jsdoc": "^39.3.3", | ||
"nodemailer": "^6.7.5", | ||
"typescript": "^4.7.2" | ||
"typescript": "^4.7.4" | ||
}, | ||
@@ -59,0 +59,0 @@ "dependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12563
214