Skip to content

Instantly share code, notes, and snippets.

Steve Freegard smfreegard

  • Fort Systems Ltd.
  • Chichester, UK
Block or report user

Report or block smfreegard

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:deefd094d6c78c6ad3ef44564ebd85e7
exports.hook_rcpt = function (next, connection) {
var txn = connection.transaction;
if (txn.rcpt_to.length > 1) {
return next(DENY, 'Multiple recipients not allowed');
}
return next();
}
View forwarder.js
const Address = require('address-rfc2821').Address;
exports.hook_rcpt = function (next, conn, rcpt) {
const txn = conn.transaction;
const cfg = this.config.get('forwarder.ini');
conn.loginfo(this, JSON.stringify(cfg));
if (rcpt && rcpt[0] && rcpt[0].host) {
var domain = rcpt[0].host.toLowerCase();
if (cfg.main[domain]) {
conn.loginfo(this, 'Found domain ' + domain + ' forwarding to ' + cfg.main[domain]);
View gist:8be95635cade83b9dc172996e99a9768
[root@mail1-ewh views]# rspamc < a.eml
Results for file: stdin (0.215 seconds)
[Metric: default]
Spam: true
Score: 14.10 / 15.00
Action: add header
Symbol: COMPROMISED_ACCT_BULK (3.00)
Symbol: DATE_IN_PAST (1.00)
Symbol: DCC_BULK (2.00)[bulk Body=1 Fuz1=many]
Symbol: DMARC_NA (0.00)[outlook.fr]
View haraka_logger2.js
var logfmt = require('logfmt');
exports.remote = {
ip: '1.2.3.4',
host: 'a.b.foo.com',
}
exports.hello = {
host: 'FOO'
}
exports.relaying = false;
View haraka_logger1.js
exports.remote = {
ip: '1.2.3.4',
host: 'a.b.foo.com',
}
exports.hello = {
host: 'FOO'
}
exports.relaying = false;
exports.early_talker = false;
exports.esmtp = true;
View abusix_stats.js
var lynx = require('lynx');
var metrics = new lynx('localhost', 8125);
var hostname = require('os').hostname();
// Connections per second
// Connections by source port (25, 80, ...)
exports.hook_lookup_rdns = function (next, conn) {
// Ignore connections from localhost
if (conn.remote_ip === '127.0.0.1' ||
conn.remote_ip === '::1')
View rspamd.local.lua
rspamd_config.NO_MX_FOR_RETURN_ADDR = {
callback = function(task)
local return_addr
local hdr_from = task:get_header('From')
local hdr_replyto = task:get_header('Reply-To')
-- Work out the return address
if (hdr_replyto) then
return_addr = hdr_replyto
elseif (hdr_from) then
View multimap.conf
freemail_envfrom {
type = "from";
filter = "email:domain";
map = "https://raw.githubusercontent.com/willwhite/freemail/master/data/free.txt";
symbol = "FREEMAIL_ENVFROM";
}
freemail_envrcpt {
type = "rcpt";
filter = "email:domain";
View smart_host_auth.js
exports.hook_data_post = function (next, connection) {
var txn = connection.transaction;
// Copy auth notes to transaction notes so they're available in hmail.todo.notes
txn.notes.auth_user = connection.notes.auth_user;
txn.notes.auth_passwd = connection.notes.auth_passwd;
return next();
}
exports.hook_get_mx = function (next, hmail, domain) {
return next(OK, {
View auth_proxy_custom.js
// Proxy AUTH requests selectively by domain
var sock = require('./line_socket');
var utils = require('./utils');
var smtp_regexp = /^([0-9]{3})([ -])(.*)/;
exports.register = function () {
this.inherits('auth/auth_base');
};
exports.hook_capabilities = function (next, connection) {
You can’t perform that action at this time.