This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var logfmt = require('logfmt'); | |
exports.remote = { | |
ip: '1.2.3.4', | |
host: 'a.b.foo.com', | |
} | |
exports.hello = { | |
host: 'FOO' | |
} | |
exports.relaying = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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) { |
NewerOlder