Comparing version 1.0.0-rc2 to 1.0.0-rc3
@@ -31,3 +31,3 @@ | ||
.option('--outgoing-secure', 'Use SMTP SSL for outgoing emails') | ||
.option('--auto-relay', 'Use auto-relay mode') | ||
.option('--auto-relay [email]', 'Use auto-relay mode. Optional relay email address') | ||
.option('--auto-relay-rules <file>', 'Filter rules for auto relay mode') | ||
@@ -75,3 +75,4 @@ .option('--incoming-user <user>', 'SMTP user for incoming emails') | ||
if (config.autoRelay) { | ||
mailserver.setAutoRelayMode(true, config.autoRelayRules) | ||
const emailAddress = typeof config.autoRelay === 'string' ? config.autoRelay : null | ||
mailserver.setAutoRelayMode(true, config.autoRelayRules, emailAddress) | ||
} | ||
@@ -78,0 +79,0 @@ |
@@ -433,4 +433,4 @@ 'use strict' | ||
mailServer.setAutoRelayMode = function (enabled, rules) { | ||
outgoing.setAutoRelayMode(enabled, rules) | ||
mailServer.setAutoRelayMode = function (enabled, rules, emailAddress) { | ||
outgoing.setAutoRelayMode(enabled, rules, emailAddress) | ||
} | ||
@@ -437,0 +437,0 @@ |
@@ -90,3 +90,3 @@ 'use strict' | ||
outgoing.setAutoRelayMode = function (enabled, rules) { | ||
outgoing.setAutoRelayMode = function (enabled, rules, emailAddress) { | ||
if (!client) { | ||
@@ -115,7 +115,15 @@ config.autoRelay = false | ||
if (enabled && emailAddress) { | ||
config.autoRelayAddress = emailAddress | ||
} | ||
if (config.autoRelay) { | ||
logger.info( | ||
'Auto-Relay mode on, relay rules: %s', | ||
JSON.stringify(config.autoRelayRules) | ||
) | ||
const msg = ['Auto-Relay mode on'] | ||
if (config.autoRelayAddress) { | ||
msg.push('Relaying all emails to ' + config.autoRelayAddress) | ||
} | ||
if (config.autoRelayRules) { | ||
msg.push('Relay rules: ' + JSON.stringify(config.autoRelayRules)) | ||
} | ||
logger.info(msg.join(', ')) | ||
} | ||
@@ -136,2 +144,7 @@ } | ||
if (isAutoRelay && config.autoRelayAddress) { | ||
emailObject.to = [{ address: config.autoRelayAddress }] | ||
emailObject.envelope.to = [{ address: config.autoRelayAddress, args: false }] | ||
} | ||
// Fallback to the object if the address key isn't defined | ||
@@ -138,0 +151,0 @@ const getAddress = function (addressObj) { |
@@ -9,3 +9,3 @@ 'use strict' | ||
const http = require('http') | ||
const io = require('socket.io')() | ||
const socketio = require('socket.io') | ||
const routes = require('./routes') | ||
@@ -22,2 +22,3 @@ const auth = require('./auth') | ||
const connections = {} | ||
let io | ||
@@ -84,8 +85,8 @@ function handleConnection (socket) { | ||
if (basePathname) { | ||
io.path(basePathname + '/socket.io') | ||
} else { | ||
if (!basePathname) { | ||
basePathname = '/' | ||
} | ||
io = socketio({ path: path.join(basePathname, '/socket.io') }) | ||
app.use(basePathname, express.static(path.join(__dirname, '../app'))) | ||
@@ -92,0 +93,0 @@ |
{ | ||
"name": "maildev", | ||
"description": "SMTP Server and Web Interface for reading and testing emails during development", | ||
"version": "1.0.0-rc2", | ||
"version": "1.0.0-rc3", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "email", |
@@ -40,3 +40,3 @@ # MailDev | ||
--outgoing-secure Use SMTP SSL for outgoing emails | ||
--auto-relay Use auto-relay mode | ||
--auto-relay [email] Use auto-relay mode. Optional relay email address | ||
--auto-relay-rules <file> Filter rules for auto relay mode | ||
@@ -95,2 +95,7 @@ --incoming-user <user> SMTP user for incoming emails | ||
Optionally you may pass an single email address which Maildev will forward all | ||
emails to instead of the original recipient. For example, using | ||
`--auto-relay you@example.com` will forward all emails to that address | ||
automatically. | ||
Additionally, you can pass a valid json file with additional configuration for | ||
@@ -97,0 +102,0 @@ what email addresses you would like to `allow` or `deny`. The last matching |
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
1973573
55
22304
216