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.
- package/Changes.md +56 -0
- package/Dockerfile +3 -3
- package/Plugins.md +5 -4
- package/README.md +4 -4
- package/TODO +1 -24
- package/config/access.domains +1 -1
- package/config/auth_flat_file.ini +1 -0
- package/config/auth_vpopmaild.ini +4 -2
- package/config/helo.checks.ini +1 -1
- package/config/outbound.ini +1 -1
- package/config/rabbitmq_amqplib.ini +8 -1
- package/connection.js +32 -10
- package/docs/Connection.md +1 -1
- package/docs/Outbound.md +6 -15
- package/docs/Plugins.md +46 -39
- package/docs/Transaction.md +1 -1
- 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/clamd.md +1 -1
- package/docs/plugins/queue/rabbitmq_amqplib.md +7 -0
- package/docs/plugins/queue/smtp_forward.md +16 -38
- package/docs/plugins/queue/smtp_proxy.md +9 -11
- package/docs/plugins/relay.md +2 -2
- package/outbound/hmail.js +2 -2
- package/outbound/queue.js +5 -0
- package/outbound/tls.js +1 -1
- package/package.json +31 -31
- package/plugins/auth/auth_base.js +27 -11
- package/plugins/auth/auth_vpopmaild.js +29 -19
- package/plugins/auth/flat_file.js +17 -12
- package/plugins/clamd.js +1 -0
- package/plugins/dns_list_base.js +3 -3
- package/plugins/helo.checks.js +15 -7
- package/plugins/queue/rabbitmq_amqplib.js +1 -1
- package/plugins/queue/smtp_forward.js +21 -15
- package/plugins/tls.js +1 -1
- package/plugins.js +1 -0
- package/tests/config/helo.checks.ini +52 -0
- package/tests/plugins/dns_list_base.js +41 -31
- package/tests/plugins/helo.checks.js +212 -239
- package/tests/plugins/queue/smtp_forward.js +36 -7
- package/tests/queue/multibyte +0 -0
- package/tests/queue/plain +0 -0
- package/transaction.js +1 -1
- 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/rcpt_to.blocklist +0 -1
- package/config/rdns.allow_regexps +0 -0
- package/config/rdns.deny_regexps +0 -0
- package/config.js +0 -6
- package/coverage/lcov.info +0 -13863
- package/coverage/tmp/coverage-42958-1658373250585-0.json +0 -1
- package/coverage/tmp/coverage-42961-1658373250529-0.json +0 -1
- 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/plugins/data.headers.js +0 -4
- package/plugins/relay_all.js +0 -13
- /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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
package/tests/queue/multibyte
CHANGED
|
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.
|
|
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.
|
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.js
DELETED