mirror of
https://github.com/nodemailer/wildduck.git
synced 2024-11-10 09:32:28 +08:00
36 lines
990 B
JavaScript
36 lines
990 B
JavaScript
'use strict';
|
|
|
|
let config = require('config');
|
|
let log = require('npmlog');
|
|
let imap = require('./imap');
|
|
let lmtp = require('./lmtp');
|
|
let smtp = require('./smtp');
|
|
let api = require('./api');
|
|
|
|
log.level = config.log.level;
|
|
|
|
imap((err, imap) => {
|
|
if (err) {
|
|
log.error('App', 'Failed to start IMAP server');
|
|
return process.exit(1);
|
|
}
|
|
lmtp(imap, err => {
|
|
if (err) {
|
|
log.error('App', 'Failed to start LMTP server');
|
|
return process.exit(1);
|
|
}
|
|
smtp(imap, err => {
|
|
if (err) {
|
|
log.error('App', 'Failed to start SMTP server');
|
|
return process.exit(1);
|
|
}
|
|
api(imap, err => {
|
|
if (err) {
|
|
log.error('App', 'Failed to start API server');
|
|
return process.exit(1);
|
|
}
|
|
log.info('App', 'All servers started, ready to process some mail');
|
|
});
|
|
});
|
|
});
|
|
});
|