Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'use strict';
// var Address = require('address-rfc2821');
const fixtures = require('haraka-test-fixtures');
const Connection = fixtures.connection;
const Transaction = fixtures.transaction;
const _set_up = function (done) {
this.plugin = new fixtures.plugin('rspamd');
this.plugin.register();
this.connection = Connection.createConnection();
this.connection.transaction = Transaction.createTransaction();
done();
};
exports.register = {
setUp : _set_up,
'loads the rspamd plugin': function (test) {
test.expect(1);
function _setup (done) {
this.plugin = new fixtures.plugin('queue/smtp_forward');
// switch config directory to 'tests/config'
this.plugin.config = this.plugin.config.module_config(path.resolve('tests'));
this.plugin.register();
this.connection = new fixtures.connection.createConnection();
this.connection.transaction = new fixtures.transaction.createTransaction();
done();
}
const _set_up = function (done) {
this.plugin = new fixtures.plugin('spf');
this.plugin.timeout = 8000;
this.plugin.load_spf_ini();
// uncomment this line to see detailed SPF evaluation
this.plugin.SPF.prototype.log_debug = () => {};
this.connection = fixtures.connection.createConnection();
this.connection.transaction = fixtures.transaction.createTransaction();
this.connection.transaction.results = new fixtures.results(this.connection);
done();
}
const _set_up = function (done) {
this.plugin = new fixtures.plugin('helo.checks');
this.plugin.config.root_path = path.resolve(__dirname, '../../config');
this.connection = fixtures.connection.createConnection();
this.connection.remote.ip='208.75.199.19';
this.plugin.register();
done();
}
function _set_up (done) {
this.plugin = new fixtures.plugin('rcpt_to.in_host_list');
this.plugin.inherits('rcpt_to.host_list_base');
this.plugin.cfg = {};
this.plugin.host_list = {};
this.connection = fixtures.connection.createConnection();
this.connection.transaction = {
results: new fixtures.results(this.connection),
notes: {},
};
done();
}
'use strict';
const fs = require('fs');
const path = require('path');
const Address = require('address-rfc2821');
const fixtures = require('haraka-test-fixtures');
const utils = require('haraka-utils');
const Connection = fixtures.connection;
const _set_up = function (done) {
this.plugin = new fixtures.plugin('dkim_sign');
this.plugin.cfg = { main: { } };
this.connection = Connection.createConnection();
this.connection.init_transaction();
this.connection.transaction.mail_from = {};
done();
}
exports.get_sender_domain = {
setUp : _set_up,
'no transaction': function (test) {
var _set_up = function (done) {
this.plugin = new fixtures.plugin('access');
this.plugin.config.module_config(path.resolve(__dirname, 'config'));
this.plugin.register();
this.connection = fixtures.connection.createConnection();
this.connection.transaction = {
results: new fixtures.results(this.connection),
};
done();
};
setUp (callback) {
this.plugin = new fixtures.plugin('relay');
this.plugin.cfg = { relay: { dest_domains: true } };
this.connection = fixtures.connection.createConnection();
callback();
},
'relay.acl=false' (test) {
'use strict';
var fixtures = require('haraka-test-fixtures');
var Connection = fixtures.connection;
var _set_up = function (done) {
this.plugin = new fixtures.plugin('connect.geoip');
this.plugin.load_geoip_ini();
this.connection = Connection.createConnection();
done();
};
exports.register = {
setUp : function (done) {
this.plugin = new fixtures.plugin('connect.geoip');
try { this.plugin.mm_loads = require('maxmind'); }
catch (ignore) {}
try { this.plugin.gl_loads = require('geoip-lite'); }
catch (ignore) {}
'use strict';
const net = require('net');
const fixtures = require('haraka-test-fixtures');
const Connection = fixtures.connection;
function _set_up (done) {
this.plugin = new fixtures.plugin('clamd');
this.plugin.register();
this.connection = Connection.createConnection();
this.connection.init_transaction();
done();
}
exports.load_clamd_ini = {
setUp : _set_up,
'none' (test) {
test.expect(1);