Haraka 3.0.1 → 3.0.3

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 (64) hide show
  1. package/Changes.md +56 -0
  2. package/Dockerfile +3 -3
  3. package/Plugins.md +5 -4
  4. package/README.md +4 -4
  5. package/TODO +1 -24
  6. package/config/access.domains +1 -1
  7. package/config/auth_flat_file.ini +1 -0
  8. package/config/auth_vpopmaild.ini +4 -2
  9. package/config/helo.checks.ini +1 -1
  10. package/config/outbound.ini +1 -1
  11. package/config/rabbitmq_amqplib.ini +8 -1
  12. package/connection.js +32 -10
  13. package/docs/Connection.md +1 -1
  14. package/docs/Outbound.md +6 -15
  15. package/docs/Plugins.md +46 -39
  16. package/docs/Transaction.md +1 -1
  17. package/docs/{plugins → deprecated}/connect.rdns_access.md +1 -1
  18. package/docs/{plugins → deprecated}/mail_from.access.md +1 -1
  19. package/docs/{plugins → deprecated}/rcpt_to.access.md +1 -1
  20. package/docs/plugins/auth/auth_vpopmaild.md +15 -19
  21. package/docs/plugins/auth/flat_file.md +23 -30
  22. package/docs/plugins/clamd.md +1 -1
  23. package/docs/plugins/queue/rabbitmq_amqplib.md +7 -0
  24. package/docs/plugins/queue/smtp_forward.md +16 -38
  25. package/docs/plugins/queue/smtp_proxy.md +9 -11
  26. package/docs/plugins/relay.md +2 -2
  27. package/outbound/hmail.js +2 -2
  28. package/outbound/queue.js +5 -0
  29. package/outbound/tls.js +1 -1
  30. package/package.json +31 -31
  31. package/plugins/auth/auth_base.js +27 -11
  32. package/plugins/auth/auth_vpopmaild.js +29 -19
  33. package/plugins/auth/flat_file.js +17 -12
  34. package/plugins/clamd.js +1 -0
  35. package/plugins/dns_list_base.js +3 -3
  36. package/plugins/helo.checks.js +15 -7
  37. package/plugins/queue/rabbitmq_amqplib.js +1 -1
  38. package/plugins/queue/smtp_forward.js +21 -15
  39. package/plugins/tls.js +1 -1
  40. package/plugins.js +1 -0
  41. package/tests/config/helo.checks.ini +52 -0
  42. package/tests/plugins/dns_list_base.js +41 -31
  43. package/tests/plugins/helo.checks.js +212 -239
  44. package/tests/plugins/queue/smtp_forward.js +36 -7
  45. package/tests/queue/multibyte +0 -0
  46. package/tests/queue/plain +0 -0
  47. package/transaction.js +1 -1
  48. package/config/lookup_rdns.strict.ini +0 -12
  49. package/config/lookup_rdns.strict.timeout +0 -1
  50. package/config/lookup_rdns.strict.whitelist +0 -1
  51. package/config/lookup_rdns.strict.whitelist_regex +0 -5
  52. package/config/rcpt_to.blocklist +0 -1
  53. package/config/rdns.allow_regexps +0 -0
  54. package/config/rdns.deny_regexps +0 -0
  55. package/config.js +0 -6
  56. package/coverage/lcov.info +0 -13863
  57. package/coverage/tmp/coverage-42958-1658373250585-0.json +0 -1
  58. package/coverage/tmp/coverage-42961-1658373250529-0.json +0 -1
  59. package/docs/plugins/relay_acl.md +0 -29
  60. package/docs/plugins/relay_all.md +0 -15
  61. package/docs/plugins/relay_force_routing.md +0 -33
  62. package/plugins/data.headers.js +0 -4
  63. package/plugins/relay_all.js +0 -13
  64. /package/docs/{plugins → deprecated}/rcpt_to.routes.md +0 -0
@@ -4,6 +4,7 @@ const path = require('path');
4
4
 
5
5
  const { Address } = require('address-rfc2821');
6
6
  const fixtures = require('haraka-test-fixtures');
7
+ const Notes = require('haraka-notes')
7
8
 
8
9
  const OK = 906;
9
10
 
@@ -14,6 +15,7 @@ function _setup (done) {
14
15
  this.plugin.config = this.plugin.config.module_config(path.resolve('tests'));
15
16
 
16
17
  this.plugin.register();
18
+ this.hmail = { todo: { notes: new Notes() } };
17
19
 
18
20
  this.connection = new fixtures.connection.createConnection();
19
21
  this.connection.transaction = new fixtures.transaction.createTransaction();
@@ -131,21 +133,29 @@ exports.get_config = {
131
133
  }
132
134
  }
133
135
 
134
- const hmail = { todo: { notes: {} } };
135
136
  exports.get_mx = {
136
137
  setUp : _setup,
137
138
  'returns no outbound route for undefined domains' (test) {
138
139
  test.expect(2);
139
- function cb (code, mx) {
140
+ this.plugin.get_mx((code, mx) => {
140
141
  test.equal(code, undefined);
141
142
  test.deepEqual(mx, undefined);
142
143
  test.done();
143
- }
144
- this.plugin.get_mx(cb, hmail, 'undefined.com');
144
+ }, this.hmail, 'undefined.com');
145
+ },
146
+ 'returns no outbound route when queue.wants !== smtp_forward' (test) {
147
+ test.expect(2);
148
+ this.hmail.todo.notes.set('queue.wants', 'outbound')
149
+ this.hmail.todo.notes.set('queue.next_hop', 'smtp://5.4.3.2:26')
150
+ this.plugin.get_mx((code, mx) => {
151
+ test.equal(code, undefined);
152
+ test.deepEqual(mx, undefined);
153
+ test.done();
154
+ }, this.hmail, 'undefined.com');
145
155
  },
146
156
  'returns an outbound route for defined domains' (test) {
147
157
  test.expect(2);
148
- function cb (code, mx) {
158
+ this.plugin.get_mx((code, mx) => {
149
159
  test.equal(code, OK);
150
160
  test.deepEqual(mx, {
151
161
  priority: 0, exchange: '1.2.3.4', port: 2555,
@@ -153,8 +163,27 @@ exports.get_mx = {
153
163
  auth_pass: 'superDuperSecret'
154
164
  });
155
165
  test.done();
156
- }
157
- this.plugin.get_mx(cb, hmail, 'test.com');
166
+ }, this.hmail, 'test.com');
167
+ },
168
+ 'is enabled when queue.wants is set' (test) {
169
+ test.expect(2);
170
+ this.hmail.todo.notes.set('queue.wants', 'smtp_forward')
171
+ this.hmail.todo.notes.set('queue.next_hop', 'smtp://4.3.2.1:465')
172
+ this.plugin.get_mx((code, mx) => {
173
+ test.equal(code, OK);
174
+ test.deepEqual(mx, { priority: 0, port: 465, exchange: '4.3.2.1' });
175
+ test.done();
176
+ }, this.hmail, 'undefined.com');
177
+ },
178
+ 'sets using_lmtp when next_hop URL is lmtp' (test) {
179
+ test.expect(2);
180
+ this.hmail.todo.notes.set('queue.wants', 'smtp_forward')
181
+ this.hmail.todo.notes.set('queue.next_hop', 'lmtp://4.3.2.1')
182
+ this.plugin.get_mx((code, mx) => {
183
+ test.equal(code, OK);
184
+ test.deepEqual(mx, { priority: 0, port: 24, using_lmtp: true, exchange: '4.3.2.1' });
185
+ test.done();
186
+ }, this.hmail, 'undefined.com');
158
187
  },
159
188
  }
160
189
 
Binary file
package/tests/queue/plain CHANGED
Binary file
package/transaction.js CHANGED
@@ -152,7 +152,7 @@ class Transaction {
152
152
  this.header_lines.push(line.toString(this.encoding).replace(/\r\n$/, '\n'));
153
153
  }
154
154
  }
155
- else if (this.header_pos && this.parse_body) {
155
+ else if (this.parse_body) {
156
156
  let new_line = line;
157
157
  if (new_line[0] === 0x2E) new_line = new_line.slice(1); // Strip leading "."
158
158
 
@@ -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 +0,0 @@
1
- # This is a blocklist for the rcpt_to line. One address per line.
File without changes
File without changes
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.')