Some fixes
This commit is contained in:
parent
640d3c2f11
commit
1270ca71f8
13 changed files with 68 additions and 73 deletions
|
@ -83,8 +83,8 @@ async function readNextChunks() {
|
|||
}
|
||||
}
|
||||
|
||||
function spawn(callback) {
|
||||
if (!config.postfixbounce.enabled) {
|
||||
function start(callback) {
|
||||
if (!config.postfixBounce.enabled) {
|
||||
return setImmediate(callback);
|
||||
}
|
||||
|
||||
|
@ -95,7 +95,7 @@ function spawn(callback) {
|
|||
});
|
||||
|
||||
server.on('error', err => {
|
||||
const port = config.postfixbounce.port;
|
||||
const port = config.postfixBounce.port;
|
||||
const bind = typeof port === 'string' ? 'Pipe ' + port : 'Port ' + port;
|
||||
|
||||
switch (err.code) {
|
||||
|
@ -115,15 +115,15 @@ function spawn(callback) {
|
|||
}
|
||||
});
|
||||
|
||||
server.listen(config.postfixbounce.port, config.postfixbounce.host, () => {
|
||||
server.listen(config.postfixBounce.port, config.postfixBounce.host, () => {
|
||||
if (started) {
|
||||
return server.close();
|
||||
}
|
||||
started = true;
|
||||
log.info('POSTFIXBOUNCE', 'Server listening on port %s', config.postfixbounce.port);
|
||||
log.info('POSTFIXBOUNCE', 'Server listening on port %s', config.postfixBounce.port);
|
||||
setImmediate(callback);
|
||||
});
|
||||
}
|
||||
|
||||
module.exports.spawn = bluebird.promisify(spawn);
|
||||
module.exports.start = bluebird.promisify(start);
|
||||
|
||||
|
|
|
@ -166,7 +166,7 @@ mailBoxServer.on('error', err => {
|
|||
log.error('Test SMTP Mailbox Server', err);
|
||||
});
|
||||
|
||||
function spawn(callback) {
|
||||
function start(callback) {
|
||||
if (config.testServer.enabled) {
|
||||
server.listen(config.testServer.port, config.testServer.host, () => {
|
||||
log.info('Test SMTP', 'Server listening on port %s', config.testServer.port);
|
||||
|
@ -194,4 +194,4 @@ function spawn(callback) {
|
|||
}
|
||||
}
|
||||
|
||||
module.exports.spawn = bluebird.promisify(spawn);
|
||||
module.exports.start = bluebird.promisify(start);
|
||||
|
|
|
@ -48,7 +48,4 @@ function start() {
|
|||
lastCheck = curUtcDate;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
start
|
||||
};
|
||||
|
||||
module.exports.start = start;
|
||||
|
|
|
@ -86,7 +86,7 @@ const server = new SMTPServer({
|
|||
onData: onData
|
||||
});
|
||||
|
||||
function spawn(callback) {
|
||||
function start(callback) {
|
||||
if (!config.verp.enabled) {
|
||||
return setImmediate(callback);
|
||||
}
|
||||
|
@ -145,4 +145,4 @@ function spawn(callback) {
|
|||
startNextHost();
|
||||
}
|
||||
|
||||
module.exports.spawn = bluebird.promisify(spawn);
|
||||
module.exports.start = bluebird.promisify(start);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue