Haraka 3.0.2 → 3.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.yaml +5 -9
- package/.prettierrc.yml +1 -0
- package/CONTRIBUTORS.md +11 -0
- package/Changes.md +1393 -1211
- package/Dockerfile +3 -3
- package/Plugins.md +119 -106
- package/README.md +7 -16
- package/TODO +1 -24
- package/bin/haraka +197 -298
- package/config/auth_flat_file.ini +2 -0
- package/config/auth_vpopmaild.ini +4 -2
- package/config/dhparams.pem +8 -0
- package/config/mail_from.is_resolvable.ini +4 -2
- package/config/me +1 -0
- package/config/outbound.ini +0 -2
- package/config/plugins +36 -35
- package/config/rabbitmq_amqplib.ini +8 -1
- package/config/smtp.ini +0 -1
- package/config/smtp.json +17 -0
- package/config/tls_cert.pem +23 -0
- package/config/tls_key.pem +28 -0
- package/connection.js +46 -73
- package/contrib/bsd-rc.d/haraka +3 -1
- package/contrib/plugin2npm.sh +6 -36
- package/docs/Connection.md +1 -1
- package/docs/CoreConfig.md +2 -2
- package/docs/Logging.md +7 -21
- package/docs/Outbound.md +104 -210
- package/docs/Plugins.md +47 -40
- package/docs/Transaction.md +59 -82
- package/docs/{plugins → deprecated}/connect.rdns_access.md +1 -1
- package/docs/{plugins → deprecated}/mail_from.access.md +1 -1
- package/docs/{plugins → deprecated}/rcpt_to.access.md +1 -1
- package/docs/plugins/auth/auth_vpopmaild.md +15 -19
- package/docs/plugins/auth/flat_file.md +23 -30
- package/docs/plugins/queue/rabbitmq_amqplib.md +7 -0
- package/docs/plugins/queue/smtp_forward.md +1 -1
- package/docs/plugins/queue/smtp_proxy.md +5 -10
- package/docs/plugins/relay.md +2 -2
- package/docs/plugins/tls.md +29 -9
- package/endpoint.js +16 -13
- package/haraka.js +10 -14
- package/host_pool.js +5 -5
- package/line_socket.js +3 -4
- package/logger.js +44 -28
- package/outbound/client_pool.js +27 -23
- package/outbound/config.js +4 -6
- package/outbound/fsync_writestream.js +1 -1
- package/outbound/hmail.js +180 -220
- package/outbound/index.js +86 -99
- package/outbound/qfile.js +1 -1
- package/outbound/queue.js +55 -43
- package/outbound/timer_queue.js +3 -2
- package/outbound/tls.js +19 -7
- package/package.json +66 -55
- package/plugins/.eslintrc.yaml +0 -6
- package/plugins/auth/auth_base.js +30 -12
- package/plugins/auth/auth_proxy.js +14 -12
- package/plugins/auth/auth_vpopmaild.js +30 -20
- package/plugins/auth/flat_file.js +17 -12
- package/plugins/block_me.js +1 -1
- package/plugins/data.signatures.js +2 -4
- package/plugins/early_talker.js +2 -1
- package/plugins/mail_from.is_resolvable.js +65 -135
- package/plugins/queue/deliver.js +4 -5
- package/plugins/queue/lmtp.js +11 -14
- package/plugins/queue/qmail-queue.js +2 -2
- package/plugins/queue/quarantine.js +2 -2
- package/plugins/queue/rabbitmq.js +16 -17
- package/plugins/queue/rabbitmq_amqplib.js +1 -1
- package/plugins/queue/smtp_forward.js +6 -6
- package/plugins/queue/smtp_proxy.js +10 -1
- package/plugins/queue/test.js +2 -2
- package/plugins/rcpt_to.host_list_base.js +5 -5
- package/plugins/rcpt_to.in_host_list.js +2 -2
- package/plugins/relay.js +6 -7
- package/plugins/reseed_rng.js +1 -1
- package/plugins/status.js +37 -33
- package/plugins/tls.js +2 -2
- package/plugins/xclient.js +3 -2
- package/plugins.js +51 -54
- package/run_tests +3 -30
- package/server.js +190 -190
- package/smtp_client.js +30 -23
- package/{tests → test}/config/plugins +0 -2
- package/{tests → test}/config/smtp.ini +1 -1
- package/test/config/tls/example.com/_.example.com.key +28 -0
- package/test/config/tls/example.com/example.com.crt +25 -0
- package/test/connection.js +302 -0
- package/test/endpoint.js +94 -0
- package/{tests → test}/fixtures/line_socket.js +1 -1
- package/{tests → test}/fixtures/util_hmailitem.js +19 -25
- package/{tests → test}/host_pool.js +42 -57
- package/test/logger.js +258 -0
- package/test/outbound/hmail.js +141 -0
- package/test/outbound/index.js +220 -0
- package/test/outbound/qfile.js +126 -0
- package/test/outbound_bounce_net_errors.js +142 -0
- package/{tests → test}/outbound_bounce_rfc3464.js +110 -122
- package/test/plugins/auth/auth_base.js +484 -0
- package/test/plugins/auth/auth_vpopmaild.js +83 -0
- package/test/plugins/early_talker.js +104 -0
- package/test/plugins/mail_from.is_resolvable.js +35 -0
- package/test/plugins/queue/smtp_forward.js +206 -0
- package/test/plugins/rcpt_to.host_list_base.js +122 -0
- package/test/plugins/rcpt_to.in_host_list.js +193 -0
- package/test/plugins/relay.js +303 -0
- package/test/plugins/status.js +130 -0
- package/test/plugins/tls.js +70 -0
- package/test/plugins.js +228 -0
- package/{tests → test}/queue/multibyte +0 -0
- package/{tests → test}/queue/plain +0 -0
- package/test/rfc1869.js +73 -0
- package/test/server.js +491 -0
- package/test/smtp_client.js +299 -0
- package/test/tls_socket.js +273 -0
- package/test/transaction.js +270 -0
- package/tls_socket.js +202 -252
- package/transaction.js +9 -24
- package/CONTRIBUTING.md +0 -1
- package/bin/dkimverify +0 -40
- package/config/access.domains +0 -13
- package/config/attachment.ctype.regex +0 -2
- package/config/attachment.filename.regex +0 -1
- package/config/avg.ini +0 -5
- package/config/bounce.ini +0 -15
- package/config/data.headers.ini +0 -61
- package/config/dkim/dkim_key_gen.sh +0 -78
- package/config/dkim_sign.ini +0 -4
- package/config/dkim_verify.ini +0 -7
- package/config/dnsbl.ini +0 -23
- package/config/greylist.ini +0 -43
- package/config/helo.checks.ini +0 -52
- package/config/lookup_rdns.strict.ini +0 -12
- package/config/lookup_rdns.strict.timeout +0 -1
- package/config/lookup_rdns.strict.whitelist +0 -1
- package/config/lookup_rdns.strict.whitelist_regex +0 -5
- package/config/messagesniffer.ini +0 -18
- package/config/rcpt_to.blocklist +0 -1
- package/config/rdns.allow_regexps +0 -0
- package/config/rdns.deny_regexps +0 -0
- package/config/spamassassin.ini +0 -56
- package/config.js +0 -6
- package/dkim.js +0 -614
- package/docs/plugins/avg.md +0 -35
- package/docs/plugins/bounce.md +0 -69
- package/docs/plugins/clamd.md +0 -147
- package/docs/plugins/esets.md +0 -8
- package/docs/plugins/greylist.md +0 -90
- package/docs/plugins/helo.checks.md +0 -135
- package/docs/plugins/messagesniffer.md +0 -163
- package/docs/plugins/relay_acl.md +0 -29
- package/docs/plugins/relay_all.md +0 -15
- package/docs/plugins/relay_force_routing.md +0 -33
- package/docs/plugins/spamassassin.md +0 -180
- package/outbound/mx_lookup.js +0 -70
- package/plugins/auth/auth_ldap.js +0 -3
- package/plugins/avg.js +0 -162
- package/plugins/backscatterer.js +0 -25
- package/plugins/bounce.js +0 -381
- package/plugins/clamd.js +0 -381
- package/plugins/data.headers.js +0 -4
- package/plugins/data.uribl.js +0 -4
- package/plugins/dkim_sign.js +0 -395
- package/plugins/dkim_verify.js +0 -62
- package/plugins/dns_list_base.js +0 -221
- package/plugins/dnsbl.js +0 -146
- package/plugins/dnswl.js +0 -58
- package/plugins/esets.js +0 -71
- package/plugins/graph.js +0 -5
- package/plugins/greylist.js +0 -645
- package/plugins/helo.checks.js +0 -533
- package/plugins/messagesniffer.js +0 -381
- package/plugins/rcpt_to.ldap.js +0 -3
- package/plugins/rcpt_to.max_count.js +0 -24
- package/plugins/relay_all.js +0 -13
- package/plugins/spamassassin.js +0 -384
- package/tests/config/dkim/example.com/dns +0 -29
- package/tests/config/dkim/example.com/private +0 -6
- package/tests/config/dkim/example.com/public +0 -4
- package/tests/config/dkim/example.com/selector +0 -1
- package/tests/config/dkim.private.key +0 -6
- package/tests/config/dkim_sign.ini +0 -4
- package/tests/config/helo.checks.ini +0 -52
- package/tests/connection.js +0 -327
- package/tests/endpoint.js +0 -128
- package/tests/fixtures/vm_harness.js +0 -59
- package/tests/logger.js +0 -327
- package/tests/outbound/hmail.js +0 -112
- package/tests/outbound/index.js +0 -324
- package/tests/outbound/qfile.js +0 -67
- package/tests/outbound_bounce_net_errors.js +0 -173
- package/tests/plugins/auth/auth_base.js +0 -463
- package/tests/plugins/auth/auth_vpopmaild.js +0 -91
- package/tests/plugins/bounce.js +0 -307
- package/tests/plugins/clamd.js +0 -224
- package/tests/plugins/deprecated/relay_acl.js +0 -140
- package/tests/plugins/deprecated/relay_all.js +0 -59
- package/tests/plugins/dkim_sign.js +0 -315
- package/tests/plugins/dkim_signer.js +0 -108
- package/tests/plugins/dns_list_base.js +0 -259
- package/tests/plugins/dnsbl.js +0 -101
- package/tests/plugins/early_talker.js +0 -115
- package/tests/plugins/greylist.js +0 -58
- package/tests/plugins/helo.checks.js +0 -525
- package/tests/plugins/mail_from.is_resolvable.js +0 -116
- package/tests/plugins/queue/smtp_forward.js +0 -221
- package/tests/plugins/rcpt_to.host_list_base.js +0 -132
- package/tests/plugins/rcpt_to.in_host_list.js +0 -218
- package/tests/plugins/relay.js +0 -339
- package/tests/plugins/spamassassin.js +0 -171
- package/tests/plugins/status.js +0 -138
- package/tests/plugins/tls.js +0 -84
- package/tests/plugins.js +0 -247
- package/tests/rfc1869.js +0 -61
- package/tests/server.js +0 -510
- package/tests/smtp_client/auth.js +0 -105
- package/tests/smtp_client/basic.js +0 -101
- package/tests/smtp_client.js +0 -80
- package/tests/tls_socket.js +0 -333
- package/tests/transaction.js +0 -284
- /package/docs/{plugins → deprecated}/dkim_sign.md +0 -0
- /package/docs/{plugins → deprecated}/dkim_verify.md +0 -0
- /package/docs/{plugins → deprecated}/dnsbl.md +0 -0
- /package/docs/{plugins → deprecated}/dnswl.md +0 -0
- /package/docs/{plugins → deprecated}/rcpt_to.routes.md +0 -0
- /package/{tests → test}/.eslintrc.yaml +0 -0
- /package/{tests → test}/config/auth_flat_file.ini +0 -0
- /package/{tests → test}/config/dhparams.pem +0 -0
- /package/{tests → test}/config/host_list +0 -0
- /package/{tests → test}/config/outbound_tls_cert.pem +0 -0
- /package/{tests → test}/config/outbound_tls_key.pem +0 -0
- /package/{tests → test}/config/smtp_forward.ini +0 -0
- /package/{tests → test}/config/tls/ec.pem +0 -0
- /package/{tests → test}/config/tls/haraka.local.pem +0 -0
- /package/{tests → test}/config/tls/mismatched.pem +0 -0
- /package/{tests → test}/config/tls.ini +0 -0
- /package/{tests → test}/config/tls_cert.pem +0 -0
- /package/{tests → test}/config/tls_key.pem +0 -0
- /package/{tests → test}/fixtures/todo_qfile.txt +0 -0
- /package/{tests → test}/installation/config/test-plugin-flat +0 -0
- /package/{tests → test}/installation/config/test-plugin.ini +0 -0
- /package/{tests → test}/installation/config/tls.ini +0 -0
- /package/{tests → test}/installation/node_modules/load_first/index.js +0 -0
- /package/{tests → test}/installation/node_modules/load_first/package.json +0 -0
- /package/{tests → test}/installation/node_modules/test-plugin/config/test-plugin-flat +0 -0
- /package/{tests → test}/installation/node_modules/test-plugin/config/test-plugin.ini +0 -0
- /package/{tests → test}/installation/node_modules/test-plugin/package.json +0 -0
- /package/{tests → test}/installation/node_modules/test-plugin/test-plugin.js +0 -0
- /package/{tests → test}/installation/plugins/base_plugin.js +0 -0
- /package/{tests → test}/installation/plugins/folder_plugin/index.js +0 -0
- /package/{tests → test}/installation/plugins/folder_plugin/package.json +0 -0
- /package/{tests → test}/installation/plugins/inherits.js +0 -0
- /package/{tests → test}/installation/plugins/load_first.js +0 -0
- /package/{tests → test}/installation/plugins/plugin.js +0 -0
- /package/{tests → test}/installation/plugins/tls.js +0 -0
- /package/{tests → test}/loud/config/dhparams.pem +0 -0
- /package/{tests → test}/loud/config/tls/goobered.pem +0 -0
- /package/{tests → test}/loud/config/tls.ini +0 -0
- /package/{tests → test}/mail_specimen/base64-root-part.txt +0 -0
- /package/{tests → test}/mail_specimen/varied-fold-lengths-preserve-data.txt +0 -0
- /package/{tests → test}/queue/1507509981169_1507509981169_0_61403_e0Y0Ym_1_fixed +0 -0
- /package/{tests → test}/queue/1507509981169_1507509981169_0_61403_e0Y0Ym_1_haraka +0 -0
- /package/{tests → test}/queue/1508269674999_1508269674999_0_34002_socVUF_1_haraka +0 -0
- /package/{tests → test}/queue/1508455115683_1508455115683_0_90253_9Q4o4V_1_haraka +0 -0
- /package/{tests → test}/queue/zero-length +0 -0
- /package/{tests → test}/test-queue/delete-me +0 -0
package/transaction.js
CHANGED
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
// An SMTP Transaction
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
const util = require('util');
|
|
4
|
+
const util = require('node:util');
|
|
6
5
|
|
|
7
|
-
// haraka npm modules
|
|
8
6
|
const Notes = require('haraka-notes');
|
|
9
7
|
const utils = require('haraka-utils');
|
|
10
|
-
|
|
11
|
-
// Haraka modules
|
|
12
8
|
const message = require('haraka-email-message')
|
|
13
9
|
|
|
14
10
|
class Transaction {
|
|
15
|
-
constructor (uuid, cfg) {
|
|
11
|
+
constructor (uuid, cfg = {}) {
|
|
16
12
|
this.uuid = uuid || utils.uuid();
|
|
17
|
-
this.cfg = cfg
|
|
13
|
+
this.cfg = cfg;
|
|
18
14
|
this.mail_from = null;
|
|
19
15
|
this.rcpt_to = [];
|
|
20
16
|
this.header_lines = [];
|
|
@@ -50,14 +46,13 @@ class Transaction {
|
|
|
50
46
|
|
|
51
47
|
this.body = new message.Body(this.header);
|
|
52
48
|
this.body.on('mime_boundary', m => this.incr_mime_count());
|
|
53
|
-
this.attachment_start_hooks.forEach(h => {
|
|
54
|
-
this.body.on('attachment_start', h);
|
|
55
|
-
});
|
|
56
49
|
|
|
57
|
-
|
|
58
|
-
this.body.
|
|
50
|
+
for (const hook of this.attachment_start_hooks) {
|
|
51
|
+
this.body.on('attachment_start', hook);
|
|
59
52
|
}
|
|
60
53
|
|
|
54
|
+
if (this.banner) this.body.set_banner(this.banner);
|
|
55
|
+
|
|
61
56
|
for (const o of this.body_filters) {
|
|
62
57
|
this.body.add_filter((ct, enc, buf) => {
|
|
63
58
|
const re_match = (util.types.isRegExp(o.ct_match) && o.ct_match.test(ct.toLowerCase()));
|
|
@@ -147,12 +142,12 @@ class Transaction {
|
|
|
147
142
|
}
|
|
148
143
|
else if (this.header_pos === 0) {
|
|
149
144
|
// Build up headers
|
|
150
|
-
if (this.header_lines.length < this.cfg
|
|
145
|
+
if (this.header_lines.length < (this.cfg?.headers?.max_lines || 1000)) {
|
|
151
146
|
if (line[0] === 0x2E) line = line.slice(1); // Strip leading '.'
|
|
152
147
|
this.header_lines.push(line.toString(this.encoding).replace(/\r\n$/, '\n'));
|
|
153
148
|
}
|
|
154
149
|
}
|
|
155
|
-
else if (this.
|
|
150
|
+
else if (this.parse_body) {
|
|
156
151
|
let new_line = line;
|
|
157
152
|
if (new_line[0] === 0x2E) new_line = new_line.slice(1); // Strip leading "."
|
|
158
153
|
|
|
@@ -255,13 +250,3 @@ exports.Transaction = Transaction;
|
|
|
255
250
|
exports.createTransaction = (uuid, cfg) => {
|
|
256
251
|
return new Transaction(uuid, cfg);
|
|
257
252
|
}
|
|
258
|
-
|
|
259
|
-
// sunset after test-fixtures createTransaction() is updated to pass in cfg
|
|
260
|
-
function load_smtp_ini () {
|
|
261
|
-
const config = require('haraka-config');
|
|
262
|
-
const cfg = config.get('smtp.ini', { booleans: [ '+headers.add_received' ] });
|
|
263
|
-
if (!cfg.headers.max_lines) {
|
|
264
|
-
cfg.headers.max_lines = parseInt(config.get('max_header_lines')) || 1000;
|
|
265
|
-
}
|
|
266
|
-
return cfg;
|
|
267
|
-
}
|
package/CONTRIBUTING.md
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
See https://github.com/haraka/Haraka/wiki/Contributing
|
package/bin/dkimverify
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
// DKIM test tool
|
|
4
|
-
|
|
5
|
-
const nopt = require('nopt');
|
|
6
|
-
const path = require('path');
|
|
7
|
-
const base_path = path.join(__dirname, '..');
|
|
8
|
-
const dkim = require(`${base_path}/dkim`);
|
|
9
|
-
const DKIMVerifyStream = dkim.DKIMVerifyStream;
|
|
10
|
-
|
|
11
|
-
const parsed = nopt({ 'debug': Boolean, 'time_skew': Number, 'help': Boolean });
|
|
12
|
-
|
|
13
|
-
function print_usage () {
|
|
14
|
-
console.log('Usage: dkimverify [--debug] [--time_skew=123] < message');
|
|
15
|
-
process.exit(1);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
if (parsed.help) print_usage()
|
|
19
|
-
|
|
20
|
-
if (!parsed.debug) {
|
|
21
|
-
dkim.DKIMObject.prototype.debug = function (str) {}
|
|
22
|
-
DKIMVerifyStream.prototype.debug = function (str) {}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const opts = {}
|
|
26
|
-
if (parsed.time_skew) opts.allowed_time_skew = parsed.time_skew
|
|
27
|
-
|
|
28
|
-
const verifier = new DKIMVerifyStream(opts, (err, result, results) => {
|
|
29
|
-
if (err) console.log(err.message);
|
|
30
|
-
if (Array.isArray(results)) {
|
|
31
|
-
results.forEach(function (res) {
|
|
32
|
-
console.log(`identity="${res.identity}" domain="${res.domain}" result=${res.result} ${(res.error) ? `(${res.error})` : ''}`);
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
console.log(`Result: ${result}`);
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
process.stdin.pipe(verifier);
|
package/config/access.domains
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# Basic whitelist/blacklist mechanism for domains and e-mail addresses
|
|
2
|
-
# add a single domain or e-mail per line
|
|
3
|
-
# default behavior for entries is to DENY or blacklist
|
|
4
|
-
# reverse behavior by prepending an exclamation point !
|
|
5
|
-
# foo.com <-- denied
|
|
6
|
-
# !foo.com <-- allowed
|
|
7
|
-
#
|
|
8
|
-
# More complex/granular behaviors are possible, e.g.
|
|
9
|
-
# To block everything claiming to be from aol.com, but still allow a single aol address:
|
|
10
|
-
# aol.com
|
|
11
|
-
# !friend@aol.com
|
|
12
|
-
#
|
|
13
|
-
# See full docs for details: http://haraka.github.io/manual/plugins/access.html
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
\.(?:ade|adp|bat|chm|cmd|com|cpl|dll|exe|hta|ins|isp|jar|js|jse|lib|lnk|mde|msc|msp|mst|pif|scr|sct|shb|sys|vb|vbe|vbs|vxd|wsc|wsf|wsh)$
|
package/config/avg.ini
DELETED
package/config/bounce.ini
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
; config/bounce_bad_rcpt: addresses that should never get bounces
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
[check]
|
|
5
|
-
single_recipient=true
|
|
6
|
-
empty_return_path=true
|
|
7
|
-
bad_rcpt=true
|
|
8
|
-
|
|
9
|
-
; reject all bounce messages (generally a bad idea)
|
|
10
|
-
reject_all=false
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
[reject]
|
|
14
|
-
single_recipient=true
|
|
15
|
-
empty_return_path=true
|
package/config/data.headers.ini
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
; configuration for data.headers plugin
|
|
2
|
-
|
|
3
|
-
; Requiring a date header will cause the loss of valid mail. The JavaMail
|
|
4
|
-
; sender used by some banks, photo processing services, health insurance
|
|
5
|
-
; companies, bounce senders, and others send messages without a Date header.
|
|
6
|
-
;
|
|
7
|
-
; If you can afford to reject some valid mail, please do enforce this, and
|
|
8
|
-
; encourage mailers toward RFC adherence. Otherwise, do not require Date.
|
|
9
|
-
|
|
10
|
-
; Headers that MUST be present (RFC 5322)
|
|
11
|
-
; required=From,Date ; <-- RFC 5322 compliant
|
|
12
|
-
required=From,Date
|
|
13
|
-
|
|
14
|
-
; Received
|
|
15
|
-
; If you have no outbound, add 'Received' to the required list for an
|
|
16
|
-
; aggressive anti-spam measure. It works because all real mail relays will
|
|
17
|
-
; add a `Received` header. It may false positive on some bulk mail that
|
|
18
|
-
; uses a custom tool to send, but this appears to be fairly rare.
|
|
19
|
-
|
|
20
|
-
; If the date header is present, and future and/or past days are
|
|
21
|
-
; defined, it will be validated. 0 = disabled
|
|
22
|
-
date_future_days=2
|
|
23
|
-
date_past_days=15
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
; Headers that MUST be unique if present (RFC 5322)
|
|
27
|
-
; singular=Date,From,Sender,Reply-To,To,Cc,Bcc,Message-Id,In-Reply-To,References,Subject (RFC 5322)
|
|
28
|
-
singular=Date,From,Sender,Reply-To,To,Cc,Bcc,Message-Id,In-Reply-To,References,Subject
|
|
29
|
-
|
|
30
|
-
; enable/disable the various header checks
|
|
31
|
-
[check]
|
|
32
|
-
; duplicate_singular=true
|
|
33
|
-
; missing_required=true
|
|
34
|
-
; invalid_return_path=true
|
|
35
|
-
; invalid_date=true
|
|
36
|
-
; user_agent=true
|
|
37
|
-
; direct_to_mx=true
|
|
38
|
-
; from_match=true
|
|
39
|
-
; mailing_list=true
|
|
40
|
-
; delivered_to=true
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
[reject]
|
|
44
|
-
; reject switches for each header check
|
|
45
|
-
; default are shown. Rejecting based on any of these
|
|
46
|
-
; criteria will result in the loss of valid mail.
|
|
47
|
-
;
|
|
48
|
-
; duplicate_singular=false
|
|
49
|
-
; missing_required=false
|
|
50
|
-
; invalid_return_path=false
|
|
51
|
-
; invalid_date=false
|
|
52
|
-
|
|
53
|
-
; arriving messages should not have Delivered-To set to the RCPT TO address.
|
|
54
|
-
; delivered_to=true
|
|
55
|
-
|
|
56
|
-
; these 4 do not have reject support, and likely shouldn't.
|
|
57
|
-
; user_agent=false
|
|
58
|
-
; direct_to_mx=false
|
|
59
|
-
; from_match=false
|
|
60
|
-
; mailing_list=false
|
|
61
|
-
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
|
|
3
|
-
DOMAIN="$1"
|
|
4
|
-
SMTPD="$2"
|
|
5
|
-
|
|
6
|
-
usage()
|
|
7
|
-
{
|
|
8
|
-
echo " usage: ${0} <example.com> [haraka username]" 2>&1
|
|
9
|
-
echo 2>&1
|
|
10
|
-
exit 1
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
if [ -z "$DOMAIN" ]; then
|
|
14
|
-
usage
|
|
15
|
-
fi
|
|
16
|
-
|
|
17
|
-
if [ -z "$SMTPD" ]; then
|
|
18
|
-
SMTPD="www"
|
|
19
|
-
fi
|
|
20
|
-
|
|
21
|
-
# Create a directory for each DKIM signing domain
|
|
22
|
-
mkdir -p "$DOMAIN"
|
|
23
|
-
cd "$DOMAIN" || exit
|
|
24
|
-
|
|
25
|
-
# The selector can be any value that is a valid DNS label
|
|
26
|
-
# Create in the common format: mmmYYYY (apr2014)
|
|
27
|
-
date '+%h%Y' | tr '[:upper:]' '[:lower:]' > selector
|
|
28
|
-
|
|
29
|
-
# Generate private and public keys
|
|
30
|
-
# - Key length considerations -
|
|
31
|
-
# The minimum recommended key length for short duration keys (ones that
|
|
32
|
-
# will be replaced within a few months) is 1024. If you are unlikely to
|
|
33
|
-
# rotate your keys frequently, choose 2048, at the expense of more CPU.
|
|
34
|
-
openssl genrsa -out private 2048
|
|
35
|
-
chmod 0400 private
|
|
36
|
-
openssl rsa -in private -out public -pubout
|
|
37
|
-
|
|
38
|
-
DNS_NAME="$(tr -d '\n' < selector)._domainkey"
|
|
39
|
-
DNS_ADDRESS="v=DKIM1;p=$(grep -v '^-' public | tr -d '\n')"
|
|
40
|
-
|
|
41
|
-
# Fold width is arbitrary, any value between 80 and 255 is reasonable
|
|
42
|
-
BIND_SPLIT_ADDRESS="$(echo "$DNS_ADDRESS" | fold -w 110 | sed -e 's/^/ "/g; s/$/"/g')"
|
|
43
|
-
|
|
44
|
-
# Make it really easy to publish the public key in DNS
|
|
45
|
-
# by creating a file named 'dns', with instructions
|
|
46
|
-
cat > dns <<EO_DKIM_DNS
|
|
47
|
-
|
|
48
|
-
Add this TXT record to the ${DOMAIN} DNS zone.
|
|
49
|
-
|
|
50
|
-
${DNS_NAME} IN TXT ${DNS_ADDRESS}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
BIND zone file formatted:
|
|
54
|
-
|
|
55
|
-
${DNS_NAME} IN TXT (
|
|
56
|
-
${BIND_SPLIT_ADDRESS}
|
|
57
|
-
)
|
|
58
|
-
|
|
59
|
-
Tell the world that the ONLY mail servers that send mail from this domain are DKIM signed and/or bear our MX and A records.
|
|
60
|
-
|
|
61
|
-
With SPF:
|
|
62
|
-
|
|
63
|
-
SPF "v=spf1 mx a -all"
|
|
64
|
-
TXT "v=spf1 mx a -all"
|
|
65
|
-
|
|
66
|
-
With DMARC:
|
|
67
|
-
|
|
68
|
-
_dmarc TXT "v=DMARC1; p=reject; adkim=s; aspf=r; rua=mailto:dmarc-feedback@${DOMAIN}; ruf=mailto:dmarc-feedback@${DOMAIN}; pct=100"
|
|
69
|
-
|
|
70
|
-
For more information about DKIM and SPF policy,
|
|
71
|
-
the documentation within each plugin contains a longer discussion and links to more detailed information:
|
|
72
|
-
|
|
73
|
-
haraka -h dkim_sign
|
|
74
|
-
haraka -h spf
|
|
75
|
-
|
|
76
|
-
EO_DKIM_DNS
|
|
77
|
-
|
|
78
|
-
cd ..
|
package/config/dkim_sign.ini
DELETED
package/config/dkim_verify.ini
DELETED
package/config/dnsbl.ini
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
; reject: (default: true)
|
|
3
|
-
; denies connections from IPs on any active DNSBL
|
|
4
|
-
reject=true
|
|
5
|
-
|
|
6
|
-
; periodically check each DNSBL, disabling ones that fail checks
|
|
7
|
-
periodic_checks = 30
|
|
8
|
-
|
|
9
|
-
; search: Default (first)
|
|
10
|
-
; first: consider first DNSBL response conclusive. End processing.
|
|
11
|
-
; all: process all DNSBL results
|
|
12
|
-
search=first
|
|
13
|
-
|
|
14
|
-
; enable_stats (Default: false)
|
|
15
|
-
; stores stats in a Redis DB (see plugins/dns_list_base)
|
|
16
|
-
;enable_stats=true
|
|
17
|
-
|
|
18
|
-
; stats_redis_host (Default: localhost)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
; zones: a comma separated list of DNSBL zones
|
|
22
|
-
; or list DNSBL zones in config/dnsbl.zones
|
|
23
|
-
zones=zen.spamhaus.org
|
package/config/greylist.ini
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
; Config for greylisting plugin
|
|
2
|
-
|
|
3
|
-
; greylisting action text
|
|
4
|
-
text = Greylisted. Please come back later.
|
|
5
|
-
|
|
6
|
-
[redis]
|
|
7
|
-
host = 127.0.0.1
|
|
8
|
-
; port = 6379
|
|
9
|
-
db = 11
|
|
10
|
-
|
|
11
|
-
[skip]
|
|
12
|
-
; skip for DNSWL hosts having high reputation
|
|
13
|
-
dnswlorg = true
|
|
14
|
-
mailspikewl = true
|
|
15
|
-
|
|
16
|
-
[period]
|
|
17
|
-
# transition path: first_connect --> black (defer) --> grey(allow) --> white (allow) --> expired
|
|
18
|
-
|
|
19
|
-
# 14 minutes
|
|
20
|
-
black = 850
|
|
21
|
-
# 25 hours
|
|
22
|
-
grey = 90000
|
|
23
|
-
# 35 days
|
|
24
|
-
white = 3024000
|
|
25
|
-
|
|
26
|
-
[envelope_whitelist]
|
|
27
|
-
# Envelope emails or domains, one per line
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
[ip_whitelist]
|
|
31
|
-
# IP or Subnet, one per line
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
[recipient_whitelist]
|
|
35
|
-
# Recipient emails or domains, one per line
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
[special_dynamic_domains]
|
|
39
|
-
# Put domains that should be always treated as dynamic here.
|
|
40
|
-
# Pattern is matched at the end of rdns
|
|
41
|
-
|
|
42
|
-
# SiteGround VPS service
|
|
43
|
-
sgvps.net
|
package/config/helo.checks.ini
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
; disable checks or reject for each test if you are worried about strictness
|
|
2
|
-
|
|
3
|
-
;dns_timeout=30
|
|
4
|
-
|
|
5
|
-
[check]
|
|
6
|
-
; match_re=true
|
|
7
|
-
; bare_ip=true
|
|
8
|
-
; dynamic=true
|
|
9
|
-
; big_company=true
|
|
10
|
-
; literal_mismatch: 1 = exact IP match, 2 = IP/24 match, 3 = /24 or RFC1918
|
|
11
|
-
; literal_mismatch=2
|
|
12
|
-
; valid_hostname=true
|
|
13
|
-
; forward_dns=true
|
|
14
|
-
; rdns_match=true
|
|
15
|
-
; host_mismatch: hostname differs between EHLO invocations
|
|
16
|
-
; host_mismatch=true
|
|
17
|
-
; proto_mismatch: host sent EHLO but then tries to sent HELO or vice-versa
|
|
18
|
-
; proto_mismatch=true
|
|
19
|
-
|
|
20
|
-
[reject]
|
|
21
|
-
; host_mismatch=true
|
|
22
|
-
; proto_mismatch=false
|
|
23
|
-
; rdns_match=false
|
|
24
|
-
; dynamic=false
|
|
25
|
-
; bare_ip=false
|
|
26
|
-
; literal_mismatch=false
|
|
27
|
-
; valid_hostname=false
|
|
28
|
-
; forward_dns=false
|
|
29
|
-
; big_company=true
|
|
30
|
-
|
|
31
|
-
[skip]
|
|
32
|
-
; private_ip=true
|
|
33
|
-
; relaying=true
|
|
34
|
-
; whitelist=true ; TODO
|
|
35
|
-
|
|
36
|
-
[bigco]
|
|
37
|
-
msn.com=msn.com
|
|
38
|
-
hotmail.com=hotmail.com
|
|
39
|
-
yahoo.com=yahoo.com,yahoo.co.jp
|
|
40
|
-
yahoo.co.jp=yahoo.com,yahoo.co.jp
|
|
41
|
-
yahoo.co.uk=yahoo.co.uk
|
|
42
|
-
excite.com=excite.com,excitenetwork.com
|
|
43
|
-
mailexcite.com=excite.com,excitenetwork.com
|
|
44
|
-
yahoo.co.jp=yahoo.com,yahoo.co.jp
|
|
45
|
-
mailexcite.com=excite.com,excitenetwork.com
|
|
46
|
-
aol.com=aol.com
|
|
47
|
-
compuserve.com=compuserve.com,adelphia.net
|
|
48
|
-
nortelnetworks.com=nortelnetworks.com,nortel.com
|
|
49
|
-
earthlink.net=earthlink.net
|
|
50
|
-
earthling.net=earthling.net
|
|
51
|
-
google.com=google.com
|
|
52
|
-
gmail.com=google.com,gmail.com
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
[general]
|
|
2
|
-
nomatch=Please setup matching DNS and rDNS records.
|
|
3
|
-
timeout=60
|
|
4
|
-
timeout_msg=DNS check timed out.
|
|
5
|
-
|
|
6
|
-
[forward]
|
|
7
|
-
nxdomain=Please setup a forward DNS record.
|
|
8
|
-
dnserror=Please setup matching DNS and rDNS records.
|
|
9
|
-
|
|
10
|
-
[reverse]
|
|
11
|
-
nxdomain=Please setup a reverse DNS record.
|
|
12
|
-
dnserror=Please setup matching DNS and rDNS records.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# Hostnames and IPs are matched exactly as written on each line.
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
# Does the same thing as the whitelist file, but each line is a regex.
|
|
2
|
-
# Each line is also anchored for you, meaning '^' + regex + '$' is added for
|
|
3
|
-
# you. If you need to get around this restriction, you may use a '.*' at
|
|
4
|
-
# either the start or the end of your regex. This should help prevent people
|
|
5
|
-
# from writing overly permissive rules on accident.
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
;port=9001
|
|
2
|
-
;tmpdir=/tmp
|
|
3
|
-
;gbudb_report_deny=true
|
|
4
|
-
;tag_string=[SPAM]
|
|
5
|
-
|
|
6
|
-
;[gbudb]
|
|
7
|
-
;white=accept
|
|
8
|
-
;caution=allow
|
|
9
|
-
;black=allow
|
|
10
|
-
;truncate=reject
|
|
11
|
-
|
|
12
|
-
;[message]
|
|
13
|
-
;white=allow
|
|
14
|
-
;local_white=accept
|
|
15
|
-
;caution=allow
|
|
16
|
-
;black=allow
|
|
17
|
-
;truncate=reject
|
|
18
|
-
;nonzero=reject
|
package/config/rcpt_to.blocklist
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# This is a blocklist for the rcpt_to line. One address per line.
|
|
File without changes
|
package/config/rdns.deny_regexps
DELETED
|
File without changes
|
package/config/spamassassin.ini
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
; How does Haraka connect to the SpamAssassin spamd daemon?
|
|
2
|
-
; TCP/IP: 127.0.0.1:783
|
|
3
|
-
; socket: /var/run/spamd/spamd.sock
|
|
4
|
-
spamd_socket=127.0.0.1:783
|
|
5
|
-
|
|
6
|
-
; the username we tell spamd the message is to (default: default)
|
|
7
|
-
;spamd_user=first-recipient (see docs)
|
|
8
|
-
;spamd_user=
|
|
9
|
-
|
|
10
|
-
; messages larger than this are not scored by SA
|
|
11
|
-
max_size=500000
|
|
12
|
-
|
|
13
|
-
; Munge the subject of messages with a score higher than..
|
|
14
|
-
; munge_subject_threshold=5
|
|
15
|
-
subject_prefix=*** SPAM ***
|
|
16
|
-
|
|
17
|
-
; what to do with incoming messages with X-Spam-* headers
|
|
18
|
-
; options are: rename, drop, keep
|
|
19
|
-
old_headers_action=rename
|
|
20
|
-
|
|
21
|
-
; use the SpamAssassin 3.0+ syntax in X-Spam-Status header
|
|
22
|
-
; modern: No, score=0.8 required=8.0 tests=...
|
|
23
|
-
; legacy: No, hits=0.8 required=8.0 tests=...
|
|
24
|
-
modern_status_syntax=1
|
|
25
|
-
|
|
26
|
-
; Reject all messages with more than this many hits
|
|
27
|
-
; reject_threshold=10
|
|
28
|
-
|
|
29
|
-
; when a connection has relay privileges, the rejection limit
|
|
30
|
-
; relay_reject_threshold=7
|
|
31
|
-
|
|
32
|
-
; How long should we wait for SpamAssassin to answer the socket
|
|
33
|
-
; in seconds (default: 30)
|
|
34
|
-
;connect_timeout=
|
|
35
|
-
|
|
36
|
-
; How long should we wait for a result from SpamAssassin
|
|
37
|
-
; in seconds (default: 300)
|
|
38
|
-
;results_timeout=
|
|
39
|
-
|
|
40
|
-
; Merge SpamAssassin's headers into the message
|
|
41
|
-
;add_headers=true
|
|
42
|
-
|
|
43
|
-
; the header that is sent to spamc
|
|
44
|
-
;spamc_auth_header = X-Haraka-Relay
|
|
45
|
-
|
|
46
|
-
[check]
|
|
47
|
-
;authenticated=true
|
|
48
|
-
;private_ip=true
|
|
49
|
-
;local_ip=true
|
|
50
|
-
;relay=true
|
|
51
|
-
|
|
52
|
-
[defer]
|
|
53
|
-
; Set to true to return DENYSOFT on errors, connection timeouts, or scanning timeouts
|
|
54
|
-
;error=false
|
|
55
|
-
;connect_timeout=false
|
|
56
|
-
;scan_timeout=false
|
package/config.js
DELETED