How to use the haraka-config.module_config function in haraka-config

To help you get started, we’ve selected a few haraka-config examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github haraka / Haraka / tests / server.js View on Github external
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();
    })
}

haraka-config

Haraka's config file loader

MIT
Latest version published 6 days ago

Package Health Score

76 / 100
Full package analysis

Popular haraka-config functions

Similar packages