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.
Files changed (267) hide show
  1. package/.eslintrc.yaml +5 -9
  2. package/.prettierrc.yml +1 -0
  3. package/CONTRIBUTORS.md +11 -0
  4. package/Changes.md +1393 -1211
  5. package/Dockerfile +3 -3
  6. package/Plugins.md +119 -106
  7. package/README.md +7 -16
  8. package/TODO +1 -24
  9. package/bin/haraka +197 -298
  10. package/config/auth_flat_file.ini +2 -0
  11. package/config/auth_vpopmaild.ini +4 -2
  12. package/config/dhparams.pem +8 -0
  13. package/config/mail_from.is_resolvable.ini +4 -2
  14. package/config/me +1 -0
  15. package/config/outbound.ini +0 -2
  16. package/config/plugins +36 -35
  17. package/config/rabbitmq_amqplib.ini +8 -1
  18. package/config/smtp.ini +0 -1
  19. package/config/smtp.json +17 -0
  20. package/config/tls_cert.pem +23 -0
  21. package/config/tls_key.pem +28 -0
  22. package/connection.js +46 -73
  23. package/contrib/bsd-rc.d/haraka +3 -1
  24. package/contrib/plugin2npm.sh +6 -36
  25. package/docs/Connection.md +1 -1
  26. package/docs/CoreConfig.md +2 -2
  27. package/docs/Logging.md +7 -21
  28. package/docs/Outbound.md +104 -210
  29. package/docs/Plugins.md +47 -40
  30. package/docs/Transaction.md +59 -82
  31. package/docs/{plugins → deprecated}/connect.rdns_access.md +1 -1
  32. package/docs/{plugins → deprecated}/mail_from.access.md +1 -1
  33. package/docs/{plugins → deprecated}/rcpt_to.access.md +1 -1
  34. package/docs/plugins/auth/auth_vpopmaild.md +15 -19
  35. package/docs/plugins/auth/flat_file.md +23 -30
  36. package/docs/plugins/queue/rabbitmq_amqplib.md +7 -0
  37. package/docs/plugins/queue/smtp_forward.md +1 -1
  38. package/docs/plugins/queue/smtp_proxy.md +5 -10
  39. package/docs/plugins/relay.md +2 -2
  40. package/docs/plugins/tls.md +29 -9
  41. package/endpoint.js +16 -13
  42. package/haraka.js +10 -14
  43. package/host_pool.js +5 -5
  44. package/line_socket.js +3 -4
  45. package/logger.js +44 -28
  46. package/outbound/client_pool.js +27 -23
  47. package/outbound/config.js +4 -6
  48. package/outbound/fsync_writestream.js +1 -1
  49. package/outbound/hmail.js +180 -220
  50. package/outbound/index.js +86 -99
  51. package/outbound/qfile.js +1 -1
  52. package/outbound/queue.js +55 -43
  53. package/outbound/timer_queue.js +3 -2
  54. package/outbound/tls.js +19 -7
  55. package/package.json +66 -55
  56. package/plugins/.eslintrc.yaml +0 -6
  57. package/plugins/auth/auth_base.js +30 -12
  58. package/plugins/auth/auth_proxy.js +14 -12
  59. package/plugins/auth/auth_vpopmaild.js +30 -20
  60. package/plugins/auth/flat_file.js +17 -12
  61. package/plugins/block_me.js +1 -1
  62. package/plugins/data.signatures.js +2 -4
  63. package/plugins/early_talker.js +2 -1
  64. package/plugins/mail_from.is_resolvable.js +65 -135
  65. package/plugins/queue/deliver.js +4 -5
  66. package/plugins/queue/lmtp.js +11 -14
  67. package/plugins/queue/qmail-queue.js +2 -2
  68. package/plugins/queue/quarantine.js +2 -2
  69. package/plugins/queue/rabbitmq.js +16 -17
  70. package/plugins/queue/rabbitmq_amqplib.js +1 -1
  71. package/plugins/queue/smtp_forward.js +6 -6
  72. package/plugins/queue/smtp_proxy.js +10 -1
  73. package/plugins/queue/test.js +2 -2
  74. package/plugins/rcpt_to.host_list_base.js +5 -5
  75. package/plugins/rcpt_to.in_host_list.js +2 -2
  76. package/plugins/relay.js +6 -7
  77. package/plugins/reseed_rng.js +1 -1
  78. package/plugins/status.js +37 -33
  79. package/plugins/tls.js +2 -2
  80. package/plugins/xclient.js +3 -2
  81. package/plugins.js +51 -54
  82. package/run_tests +3 -30
  83. package/server.js +190 -190
  84. package/smtp_client.js +30 -23
  85. package/{tests → test}/config/plugins +0 -2
  86. package/{tests → test}/config/smtp.ini +1 -1
  87. package/test/config/tls/example.com/_.example.com.key +28 -0
  88. package/test/config/tls/example.com/example.com.crt +25 -0
  89. package/test/connection.js +302 -0
  90. package/test/endpoint.js +94 -0
  91. package/{tests → test}/fixtures/line_socket.js +1 -1
  92. package/{tests → test}/fixtures/util_hmailitem.js +19 -25
  93. package/{tests → test}/host_pool.js +42 -57
  94. package/test/logger.js +258 -0
  95. package/test/outbound/hmail.js +141 -0
  96. package/test/outbound/index.js +220 -0
  97. package/test/outbound/qfile.js +126 -0
  98. package/test/outbound_bounce_net_errors.js +142 -0
  99. package/{tests → test}/outbound_bounce_rfc3464.js +110 -122
  100. package/test/plugins/auth/auth_base.js +484 -0
  101. package/test/plugins/auth/auth_vpopmaild.js +83 -0
  102. package/test/plugins/early_talker.js +104 -0
  103. package/test/plugins/mail_from.is_resolvable.js +35 -0
  104. package/test/plugins/queue/smtp_forward.js +206 -0
  105. package/test/plugins/rcpt_to.host_list_base.js +122 -0
  106. package/test/plugins/rcpt_to.in_host_list.js +193 -0
  107. package/test/plugins/relay.js +303 -0
  108. package/test/plugins/status.js +130 -0
  109. package/test/plugins/tls.js +70 -0
  110. package/test/plugins.js +228 -0
  111. package/{tests → test}/queue/multibyte +0 -0
  112. package/{tests → test}/queue/plain +0 -0
  113. package/test/rfc1869.js +73 -0
  114. package/test/server.js +491 -0
  115. package/test/smtp_client.js +299 -0
  116. package/test/tls_socket.js +273 -0
  117. package/test/transaction.js +270 -0
  118. package/tls_socket.js +202 -252
  119. package/transaction.js +9 -24
  120. package/CONTRIBUTING.md +0 -1
  121. package/bin/dkimverify +0 -40
  122. package/config/access.domains +0 -13
  123. package/config/attachment.ctype.regex +0 -2
  124. package/config/attachment.filename.regex +0 -1
  125. package/config/avg.ini +0 -5
  126. package/config/bounce.ini +0 -15
  127. package/config/data.headers.ini +0 -61
  128. package/config/dkim/dkim_key_gen.sh +0 -78
  129. package/config/dkim_sign.ini +0 -4
  130. package/config/dkim_verify.ini +0 -7
  131. package/config/dnsbl.ini +0 -23
  132. package/config/greylist.ini +0 -43
  133. package/config/helo.checks.ini +0 -52
  134. package/config/lookup_rdns.strict.ini +0 -12
  135. package/config/lookup_rdns.strict.timeout +0 -1
  136. package/config/lookup_rdns.strict.whitelist +0 -1
  137. package/config/lookup_rdns.strict.whitelist_regex +0 -5
  138. package/config/messagesniffer.ini +0 -18
  139. package/config/rcpt_to.blocklist +0 -1
  140. package/config/rdns.allow_regexps +0 -0
  141. package/config/rdns.deny_regexps +0 -0
  142. package/config/spamassassin.ini +0 -56
  143. package/config.js +0 -6
  144. package/dkim.js +0 -614
  145. package/docs/plugins/avg.md +0 -35
  146. package/docs/plugins/bounce.md +0 -69
  147. package/docs/plugins/clamd.md +0 -147
  148. package/docs/plugins/esets.md +0 -8
  149. package/docs/plugins/greylist.md +0 -90
  150. package/docs/plugins/helo.checks.md +0 -135
  151. package/docs/plugins/messagesniffer.md +0 -163
  152. package/docs/plugins/relay_acl.md +0 -29
  153. package/docs/plugins/relay_all.md +0 -15
  154. package/docs/plugins/relay_force_routing.md +0 -33
  155. package/docs/plugins/spamassassin.md +0 -180
  156. package/outbound/mx_lookup.js +0 -70
  157. package/plugins/auth/auth_ldap.js +0 -3
  158. package/plugins/avg.js +0 -162
  159. package/plugins/backscatterer.js +0 -25
  160. package/plugins/bounce.js +0 -381
  161. package/plugins/clamd.js +0 -381
  162. package/plugins/data.headers.js +0 -4
  163. package/plugins/data.uribl.js +0 -4
  164. package/plugins/dkim_sign.js +0 -395
  165. package/plugins/dkim_verify.js +0 -62
  166. package/plugins/dns_list_base.js +0 -221
  167. package/plugins/dnsbl.js +0 -146
  168. package/plugins/dnswl.js +0 -58
  169. package/plugins/esets.js +0 -71
  170. package/plugins/graph.js +0 -5
  171. package/plugins/greylist.js +0 -645
  172. package/plugins/helo.checks.js +0 -533
  173. package/plugins/messagesniffer.js +0 -381
  174. package/plugins/rcpt_to.ldap.js +0 -3
  175. package/plugins/rcpt_to.max_count.js +0 -24
  176. package/plugins/relay_all.js +0 -13
  177. package/plugins/spamassassin.js +0 -384
  178. package/tests/config/dkim/example.com/dns +0 -29
  179. package/tests/config/dkim/example.com/private +0 -6
  180. package/tests/config/dkim/example.com/public +0 -4
  181. package/tests/config/dkim/example.com/selector +0 -1
  182. package/tests/config/dkim.private.key +0 -6
  183. package/tests/config/dkim_sign.ini +0 -4
  184. package/tests/config/helo.checks.ini +0 -52
  185. package/tests/connection.js +0 -327
  186. package/tests/endpoint.js +0 -128
  187. package/tests/fixtures/vm_harness.js +0 -59
  188. package/tests/logger.js +0 -327
  189. package/tests/outbound/hmail.js +0 -112
  190. package/tests/outbound/index.js +0 -324
  191. package/tests/outbound/qfile.js +0 -67
  192. package/tests/outbound_bounce_net_errors.js +0 -173
  193. package/tests/plugins/auth/auth_base.js +0 -463
  194. package/tests/plugins/auth/auth_vpopmaild.js +0 -91
  195. package/tests/plugins/bounce.js +0 -307
  196. package/tests/plugins/clamd.js +0 -224
  197. package/tests/plugins/deprecated/relay_acl.js +0 -140
  198. package/tests/plugins/deprecated/relay_all.js +0 -59
  199. package/tests/plugins/dkim_sign.js +0 -315
  200. package/tests/plugins/dkim_signer.js +0 -108
  201. package/tests/plugins/dns_list_base.js +0 -259
  202. package/tests/plugins/dnsbl.js +0 -101
  203. package/tests/plugins/early_talker.js +0 -115
  204. package/tests/plugins/greylist.js +0 -58
  205. package/tests/plugins/helo.checks.js +0 -525
  206. package/tests/plugins/mail_from.is_resolvable.js +0 -116
  207. package/tests/plugins/queue/smtp_forward.js +0 -221
  208. package/tests/plugins/rcpt_to.host_list_base.js +0 -132
  209. package/tests/plugins/rcpt_to.in_host_list.js +0 -218
  210. package/tests/plugins/relay.js +0 -339
  211. package/tests/plugins/spamassassin.js +0 -171
  212. package/tests/plugins/status.js +0 -138
  213. package/tests/plugins/tls.js +0 -84
  214. package/tests/plugins.js +0 -247
  215. package/tests/rfc1869.js +0 -61
  216. package/tests/server.js +0 -510
  217. package/tests/smtp_client/auth.js +0 -105
  218. package/tests/smtp_client/basic.js +0 -101
  219. package/tests/smtp_client.js +0 -80
  220. package/tests/tls_socket.js +0 -333
  221. package/tests/transaction.js +0 -284
  222. /package/docs/{plugins → deprecated}/dkim_sign.md +0 -0
  223. /package/docs/{plugins → deprecated}/dkim_verify.md +0 -0
  224. /package/docs/{plugins → deprecated}/dnsbl.md +0 -0
  225. /package/docs/{plugins → deprecated}/dnswl.md +0 -0
  226. /package/docs/{plugins → deprecated}/rcpt_to.routes.md +0 -0
  227. /package/{tests → test}/.eslintrc.yaml +0 -0
  228. /package/{tests → test}/config/auth_flat_file.ini +0 -0
  229. /package/{tests → test}/config/dhparams.pem +0 -0
  230. /package/{tests → test}/config/host_list +0 -0
  231. /package/{tests → test}/config/outbound_tls_cert.pem +0 -0
  232. /package/{tests → test}/config/outbound_tls_key.pem +0 -0
  233. /package/{tests → test}/config/smtp_forward.ini +0 -0
  234. /package/{tests → test}/config/tls/ec.pem +0 -0
  235. /package/{tests → test}/config/tls/haraka.local.pem +0 -0
  236. /package/{tests → test}/config/tls/mismatched.pem +0 -0
  237. /package/{tests → test}/config/tls.ini +0 -0
  238. /package/{tests → test}/config/tls_cert.pem +0 -0
  239. /package/{tests → test}/config/tls_key.pem +0 -0
  240. /package/{tests → test}/fixtures/todo_qfile.txt +0 -0
  241. /package/{tests → test}/installation/config/test-plugin-flat +0 -0
  242. /package/{tests → test}/installation/config/test-plugin.ini +0 -0
  243. /package/{tests → test}/installation/config/tls.ini +0 -0
  244. /package/{tests → test}/installation/node_modules/load_first/index.js +0 -0
  245. /package/{tests → test}/installation/node_modules/load_first/package.json +0 -0
  246. /package/{tests → test}/installation/node_modules/test-plugin/config/test-plugin-flat +0 -0
  247. /package/{tests → test}/installation/node_modules/test-plugin/config/test-plugin.ini +0 -0
  248. /package/{tests → test}/installation/node_modules/test-plugin/package.json +0 -0
  249. /package/{tests → test}/installation/node_modules/test-plugin/test-plugin.js +0 -0
  250. /package/{tests → test}/installation/plugins/base_plugin.js +0 -0
  251. /package/{tests → test}/installation/plugins/folder_plugin/index.js +0 -0
  252. /package/{tests → test}/installation/plugins/folder_plugin/package.json +0 -0
  253. /package/{tests → test}/installation/plugins/inherits.js +0 -0
  254. /package/{tests → test}/installation/plugins/load_first.js +0 -0
  255. /package/{tests → test}/installation/plugins/plugin.js +0 -0
  256. /package/{tests → test}/installation/plugins/tls.js +0 -0
  257. /package/{tests → test}/loud/config/dhparams.pem +0 -0
  258. /package/{tests → test}/loud/config/tls/goobered.pem +0 -0
  259. /package/{tests → test}/loud/config/tls.ini +0 -0
  260. /package/{tests → test}/mail_specimen/base64-root-part.txt +0 -0
  261. /package/{tests → test}/mail_specimen/varied-fold-lengths-preserve-data.txt +0 -0
  262. /package/{tests → test}/queue/1507509981169_1507509981169_0_61403_e0Y0Ym_1_fixed +0 -0
  263. /package/{tests → test}/queue/1507509981169_1507509981169_0_61403_e0Y0Ym_1_haraka +0 -0
  264. /package/{tests → test}/queue/1508269674999_1508269674999_0_34002_socVUF_1_haraka +0 -0
  265. /package/{tests → test}/queue/1508455115683_1508455115683_0_90253_9Q4o4V_1_haraka +0 -0
  266. /package/{tests → test}/queue/zero-length +0 -0
  267. /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
- // node.js built-in modules
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 || load_smtp_ini();
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
- if (this.banner) {
58
- this.body.set_banner(this.banner);
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.headers.max_lines) {
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.header_pos && this.parse_body) {
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);
@@ -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,2 +0,0 @@
1
- executable
2
- partial
@@ -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
@@ -1,5 +0,0 @@
1
- ;host=
2
- ;port=54322
3
- ;tmpdir=/tmp
4
- ;connect_timeout=10
5
- ;session_timeout=30
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
@@ -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 ..
@@ -1,4 +0,0 @@
1
- disabled = true
2
- selector = mail
3
- domain = example.com
4
- headers_to_sign = From, Sender, Reply-To, Subject, Date, Message-ID, To, Cc, MIME-Version
@@ -1,7 +0,0 @@
1
-
2
- ; Recommended (but not default) values presented below.
3
-
4
- ; in secs
5
- ;allowed_time_skew = 60
6
- ;
7
- ;sigerror_log_level = info
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
@@ -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
@@ -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
@@ -1 +0,0 @@
1
- # This is a blocklist for the rcpt_to line. One address per line.
File without changes
File without changes
@@ -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
@@ -1,6 +0,0 @@
1
- 'use strict'
2
-
3
- module.exports = require('haraka-config')
4
-
5
- // use emit is the same way util.deprecate does it, so follow that style
6
- process.emit('warning', 'Loading config via require("./config") is deprecated, please use: require("haraka-config") instead.')