Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function _setupServer (test, ip_port, done) {
process.env.YES_REALLY_DO_DISCARD=1; // for queue/discard plugin
process.env.HARAKA_TEST_DIR=path.resolve('tests');
// test sets the default path for plugin instances to the test dir
const test_cfg_path=path.resolve('tests');
test.server = require('../server');
test.config = require('haraka-config').module_config(test_cfg_path);
test.server.logger.loglevel = 6; // INFO
// set the default path for the plugin loader
test.server.config = test.config.module_config(test_cfg_path);
test.server.plugins.config = test.config.module_config(test_cfg_path);
// test.server.outbound.config = test.config.module_config(test_cfg_path);
test.server.load_smtp_ini();
test.server.cfg.main.listen = ip_port;
test.server.cfg.main.smtps_port = 2465;
// console.log(test.server.cfg);
test.server.load_default_tls_config(() => {
test.server.createServer({});
done();
})
}