Haraka 3.1.0 → 3.1.2
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/.prettierignore +4 -0
- package/CONTRIBUTORS.md +5 -5
- package/Changes.md +69 -50
- package/Plugins.md +3 -1
- package/README.md +1 -1
- package/bin/haraka +475 -478
- package/config/outbound.ini +3 -0
- package/connection.js +1072 -1108
- package/docs/Connection.md +29 -30
- package/docs/CoreConfig.md +38 -39
- package/docs/CustomReturnCodes.md +0 -1
- package/docs/HAProxy.md +2 -2
- package/docs/Header.md +1 -1
- package/docs/Logging.md +29 -5
- package/docs/Outbound.md +93 -78
- package/docs/Plugins.md +103 -108
- package/docs/Transaction.md +49 -51
- package/docs/Tutorial.md +127 -143
- package/docs/deprecated/access.md +0 -1
- package/docs/deprecated/backscatterer.md +2 -3
- package/docs/deprecated/connect.rdns_access.md +18 -27
- package/docs/deprecated/data.headers.md +0 -1
- package/docs/deprecated/data.nomsgid.md +1 -2
- package/docs/deprecated/data.noreceived.md +1 -2
- package/docs/deprecated/data.rfc5322_header_checks.md +1 -2
- package/docs/deprecated/dkim_sign.md +13 -17
- package/docs/deprecated/dkim_verify.md +9 -17
- package/docs/deprecated/dnsbl.md +36 -38
- package/docs/deprecated/dnswl.md +41 -43
- package/docs/deprecated/lookup_rdns.strict.md +21 -34
- package/docs/deprecated/mail_from.access.md +17 -25
- package/docs/deprecated/mail_from.blocklist.md +9 -12
- package/docs/deprecated/mail_from.nobounces.md +1 -2
- package/docs/deprecated/rcpt_to.access.md +20 -27
- package/docs/deprecated/rcpt_to.blocklist.md +10 -13
- package/docs/deprecated/rcpt_to.routes.md +0 -1
- package/docs/deprecated/rdns.regexp.md +13 -15
- package/docs/plugins/aliases.md +89 -89
- package/docs/plugins/auth/auth_bridge.md +5 -7
- package/docs/plugins/auth/auth_ldap.md +11 -14
- package/docs/plugins/auth/auth_proxy.md +10 -12
- package/docs/plugins/auth/auth_vpopmaild.md +5 -6
- package/docs/plugins/auth/flat_file.md +4 -4
- package/docs/plugins/block_me.md +3 -3
- package/docs/plugins/data.signatures.md +1 -2
- package/docs/plugins/delay_deny.md +3 -4
- package/docs/plugins/max_unrecognized_commands.md +4 -4
- package/docs/plugins/prevent_credential_leaks.md +6 -6
- package/docs/plugins/process_title.md +18 -18
- package/docs/plugins/queue/deliver.md +2 -3
- package/docs/plugins/queue/discard.md +4 -4
- package/docs/plugins/queue/lmtp.md +1 -3
- package/docs/plugins/queue/qmail-queue.md +7 -9
- package/docs/plugins/queue/quarantine.md +16 -21
- package/docs/plugins/queue/rabbitmq.md +8 -11
- package/docs/plugins/queue/rabbitmq_amqplib.md +43 -39
- package/docs/plugins/queue/smtp_bridge.md +7 -10
- package/docs/plugins/queue/smtp_forward.md +42 -34
- package/docs/plugins/queue/smtp_proxy.md +30 -29
- package/docs/plugins/queue/test.md +1 -3
- package/docs/plugins/rcpt_to.in_host_list.md +6 -6
- package/docs/plugins/rcpt_to.max_count.md +1 -1
- package/docs/plugins/record_envelope_addresses.md +3 -3
- package/docs/plugins/reseed_rng.md +6 -6
- package/docs/plugins/status.md +9 -8
- package/docs/plugins/tarpit.md +7 -11
- package/docs/plugins/tls.md +12 -17
- package/docs/plugins/toobusy.md +4 -4
- package/docs/plugins/xclient.md +3 -3
- package/docs/tutorials/Migrating_from_v1_to_v2.md +19 -41
- package/docs/tutorials/SettingUpOutbound.md +6 -9
- package/endpoint.js +35 -38
- package/eslint.config.mjs +22 -19
- package/haraka.js +42 -47
- package/host_pool.js +75 -79
- package/http/html/404.html +45 -49
- package/http/html/index.html +39 -28
- package/http/package.json +2 -4
- package/line_socket.js +27 -28
- package/logger.js +182 -201
- package/outbound/client_pool.js +34 -27
- package/outbound/config.js +64 -59
- package/outbound/fsync_writestream.js +24 -25
- package/outbound/hmail.js +888 -835
- package/outbound/index.js +194 -187
- package/outbound/qfile.js +49 -52
- package/outbound/queue.js +197 -190
- package/outbound/timer_queue.js +41 -43
- package/outbound/tls.js +68 -61
- package/outbound/todo.js +11 -11
- package/package.json +38 -33
- package/plugins/.eslintrc.yaml +0 -1
- package/plugins/auth/auth_base.js +123 -127
- package/plugins/auth/auth_bridge.js +7 -7
- package/plugins/auth/auth_proxy.js +121 -126
- package/plugins/auth/auth_vpopmaild.js +84 -85
- package/plugins/auth/flat_file.js +18 -17
- package/plugins/block_me.js +31 -31
- package/plugins/data.signatures.js +13 -13
- package/plugins/delay_deny.js +65 -61
- package/plugins/prevent_credential_leaks.js +23 -23
- package/plugins/process_title.js +125 -128
- package/plugins/profile.js +5 -5
- package/plugins/queue/deliver.js +3 -3
- package/plugins/queue/discard.js +13 -14
- package/plugins/queue/lmtp.js +16 -17
- package/plugins/queue/qmail-queue.js +54 -55
- package/plugins/queue/quarantine.js +68 -70
- package/plugins/queue/rabbitmq.js +80 -87
- package/plugins/queue/rabbitmq_amqplib.js +75 -54
- package/plugins/queue/smtp_bridge.js +16 -16
- package/plugins/queue/smtp_forward.js +175 -179
- package/plugins/queue/smtp_proxy.js +69 -71
- package/plugins/queue/test.js +9 -9
- package/plugins/rcpt_to.host_list_base.js +30 -34
- package/plugins/rcpt_to.in_host_list.js +19 -19
- package/plugins/record_envelope_addresses.js +4 -4
- package/plugins/reseed_rng.js +4 -4
- package/plugins/status.js +90 -97
- package/plugins/tarpit.js +25 -14
- package/plugins/tls.js +68 -68
- package/plugins/toobusy.js +21 -23
- package/plugins/xclient.js +51 -53
- package/plugins.js +276 -293
- package/rfc1869.js +30 -35
- package/server.js +308 -299
- package/smtp_client.js +244 -228
- package/test/.eslintrc.yaml +0 -1
- package/test/connection.js +127 -134
- package/test/endpoint.js +53 -47
- package/test/fixtures/line_socket.js +12 -12
- package/test/fixtures/util_hmailitem.js +89 -85
- package/test/host_pool.js +90 -92
- package/test/installation/plugins/base_plugin.js +2 -2
- package/test/installation/plugins/folder_plugin/index.js +2 -3
- package/test/installation/plugins/inherits.js +3 -3
- package/test/installation/plugins/load_first.js +2 -3
- package/test/installation/plugins/plugin.js +1 -3
- package/test/installation/plugins/tls.js +2 -4
- package/test/logger.js +135 -116
- package/test/outbound/hmail.js +49 -35
- package/test/outbound/index.js +118 -101
- package/test/outbound/qfile.js +51 -53
- package/test/outbound_bounce_net_errors.js +84 -69
- package/test/outbound_bounce_rfc3464.js +235 -165
- package/test/plugins/auth/auth_base.js +420 -279
- package/test/plugins/auth/auth_vpopmaild.js +38 -39
- package/test/plugins/queue/smtp_forward.js +126 -104
- package/test/plugins/rcpt_to.host_list_base.js +85 -67
- package/test/plugins/rcpt_to.in_host_list.js +159 -112
- package/test/plugins/status.js +71 -64
- package/test/plugins/tls.js +37 -34
- package/test/plugins.js +97 -92
- package/test/rfc1869.js +19 -26
- package/test/server.js +293 -272
- package/test/smtp_client.js +180 -176
- package/test/tls_socket.js +62 -66
- package/test/transaction.js +159 -160
- package/tls_socket.js +331 -333
- package/transaction.js +129 -137
|
@@ -1,92 +1,96 @@
|
|
|
1
|
-
'use strict'
|
|
1
|
+
'use strict'
|
|
2
2
|
const assert = require('node:assert')
|
|
3
3
|
|
|
4
|
-
const { Address } = require('address-rfc2821')
|
|
5
|
-
const fixtures = require('haraka-test-fixtures')
|
|
6
|
-
const utils = require('haraka-utils')
|
|
4
|
+
const { Address } = require('address-rfc2821')
|
|
5
|
+
const fixtures = require('haraka-test-fixtures')
|
|
6
|
+
const utils = require('haraka-utils')
|
|
7
7
|
|
|
8
8
|
const _set_up = (done) => {
|
|
9
|
-
|
|
10
|
-
this.plugin = new fixtures.plugin('auth/auth_base');
|
|
9
|
+
this.plugin = new fixtures.plugin('auth/auth_base')
|
|
11
10
|
|
|
12
11
|
this.plugin.get_plain_passwd = (user, cb) => {
|
|
13
|
-
if (user === 'test') return cb('testpass')
|
|
14
|
-
return cb(null)
|
|
15
|
-
}
|
|
12
|
+
if (user === 'test') return cb('testpass')
|
|
13
|
+
return cb(null)
|
|
14
|
+
}
|
|
16
15
|
|
|
17
|
-
this.connection = fixtures.connection.createConnection()
|
|
18
|
-
this.connection.capabilities=null
|
|
16
|
+
this.connection = fixtures.connection.createConnection()
|
|
17
|
+
this.connection.capabilities = null
|
|
19
18
|
|
|
20
|
-
done()
|
|
19
|
+
done()
|
|
21
20
|
}
|
|
22
21
|
|
|
23
22
|
const _set_up_2 = (done) => {
|
|
24
|
-
|
|
25
|
-
this.plugin = new fixtures.plugin('auth/auth_base');
|
|
23
|
+
this.plugin = new fixtures.plugin('auth/auth_base')
|
|
26
24
|
|
|
27
25
|
this.plugin.get_plain_passwd = (user, connection, cb) => {
|
|
28
|
-
connection.notes.auth_custom_note = 'custom_note'
|
|
29
|
-
if (user === 'test') return cb('testpass')
|
|
30
|
-
return cb(null)
|
|
31
|
-
}
|
|
26
|
+
connection.notes.auth_custom_note = 'custom_note'
|
|
27
|
+
if (user === 'test') return cb('testpass')
|
|
28
|
+
return cb(null)
|
|
29
|
+
}
|
|
32
30
|
|
|
33
|
-
this.connection = fixtures.connection.createConnection()
|
|
34
|
-
this.connection.capabilities=null
|
|
31
|
+
this.connection = fixtures.connection.createConnection()
|
|
32
|
+
this.connection.capabilities = null
|
|
35
33
|
|
|
36
|
-
done()
|
|
34
|
+
done()
|
|
37
35
|
}
|
|
38
36
|
|
|
39
37
|
const _set_up_custom_pwcb_opts = (done) => {
|
|
40
|
-
this.plugin = new fixtures.plugin('auth/auth_base')
|
|
38
|
+
this.plugin = new fixtures.plugin('auth/auth_base')
|
|
41
39
|
|
|
42
40
|
this.plugin.check_plain_passwd = (connection, user, passwd, pwok_cb) => {
|
|
43
41
|
switch (user) {
|
|
44
|
-
case 'legacyok_nomessage':
|
|
45
|
-
|
|
46
|
-
case '
|
|
47
|
-
|
|
48
|
-
case '
|
|
49
|
-
|
|
50
|
-
|
|
42
|
+
case 'legacyok_nomessage':
|
|
43
|
+
return pwok_cb(true)
|
|
44
|
+
case 'legacyfail_nomessage':
|
|
45
|
+
return pwok_cb(false)
|
|
46
|
+
case 'legacyok_message':
|
|
47
|
+
return pwok_cb(true, 'GREAT SUCCESS')
|
|
48
|
+
case 'legacyfail_message':
|
|
49
|
+
return pwok_cb(false, 'FAIL 123')
|
|
50
|
+
case 'newok':
|
|
51
|
+
return pwok_cb(true, { message: 'KOKOKO', code: 215 })
|
|
52
|
+
case 'newfail':
|
|
53
|
+
return pwok_cb(false, { message: 'OHOHOH', code: 555 })
|
|
54
|
+
default:
|
|
55
|
+
throw 'what?!'
|
|
51
56
|
}
|
|
52
|
-
}
|
|
57
|
+
}
|
|
53
58
|
|
|
54
|
-
this.connection = fixtures.connection.createConnection()
|
|
55
|
-
this.connection.capabilities=null
|
|
56
|
-
this.connection.notes.resp_strings = []
|
|
59
|
+
this.connection = fixtures.connection.createConnection()
|
|
60
|
+
this.connection.capabilities = null
|
|
61
|
+
this.connection.notes.resp_strings = []
|
|
57
62
|
this.connection.respond = (code, msg, cb) => {
|
|
58
|
-
this.connection.notes.resp_strings.push([code, msg])
|
|
59
|
-
return cb()
|
|
63
|
+
this.connection.notes.resp_strings.push([code, msg])
|
|
64
|
+
return cb()
|
|
60
65
|
}
|
|
61
66
|
|
|
62
|
-
done()
|
|
67
|
+
done()
|
|
63
68
|
}
|
|
64
69
|
|
|
65
70
|
describe('auth_base', () => {
|
|
66
|
-
|
|
67
71
|
describe('hook_capabilities', () => {
|
|
68
72
|
beforeEach(_set_up)
|
|
69
73
|
|
|
70
74
|
it('no TLS, no auth', (done) => {
|
|
71
75
|
this.plugin.hook_capabilities((rc, msg) => {
|
|
72
|
-
assert.equal(undefined, rc)
|
|
73
|
-
assert.equal(undefined, msg)
|
|
74
|
-
assert.equal(null, this.connection.capabilities)
|
|
75
|
-
done()
|
|
76
|
-
}, this.connection)
|
|
76
|
+
assert.equal(undefined, rc)
|
|
77
|
+
assert.equal(undefined, msg)
|
|
78
|
+
assert.equal(null, this.connection.capabilities)
|
|
79
|
+
done()
|
|
80
|
+
}, this.connection)
|
|
77
81
|
})
|
|
78
82
|
|
|
79
83
|
it('with TLS, auth is offered', (done) => {
|
|
80
|
-
this.connection.tls.enabled=true
|
|
81
|
-
this.connection.capabilities=[]
|
|
84
|
+
this.connection.tls.enabled = true
|
|
85
|
+
this.connection.capabilities = []
|
|
82
86
|
this.plugin.hook_capabilities((rc, msg) => {
|
|
83
|
-
assert.equal(undefined, rc)
|
|
84
|
-
assert.equal(undefined, msg)
|
|
85
|
-
assert.ok(this.connection.capabilities.length)
|
|
86
|
-
assert.ok(this.connection.capabilities[0] === 'AUTH PLAIN LOGIN CRAM-MD5')
|
|
87
|
+
assert.equal(undefined, rc)
|
|
88
|
+
assert.equal(undefined, msg)
|
|
89
|
+
assert.ok(this.connection.capabilities.length)
|
|
90
|
+
assert.ok(this.connection.capabilities[0] === 'AUTH PLAIN LOGIN CRAM-MD5')
|
|
87
91
|
// console.log(this.connection.capabilities);
|
|
88
|
-
done()
|
|
89
|
-
}, this.connection)
|
|
92
|
+
done()
|
|
93
|
+
}, this.connection)
|
|
90
94
|
})
|
|
91
95
|
})
|
|
92
96
|
|
|
@@ -94,16 +98,16 @@ describe('auth_base', () => {
|
|
|
94
98
|
beforeEach(_set_up)
|
|
95
99
|
|
|
96
100
|
it('get_plain_passwd, no result', (done) => {
|
|
97
|
-
this.plugin.get_plain_passwd('user', pass => {
|
|
98
|
-
assert.equal(pass, null)
|
|
99
|
-
done()
|
|
100
|
-
})
|
|
101
|
+
this.plugin.get_plain_passwd('user', (pass) => {
|
|
102
|
+
assert.equal(pass, null)
|
|
103
|
+
done()
|
|
104
|
+
})
|
|
101
105
|
})
|
|
102
106
|
it('get_plain_passwd, test user', (done) => {
|
|
103
|
-
this.plugin.get_plain_passwd('test', pass => {
|
|
104
|
-
assert.equal(pass, 'testpass')
|
|
105
|
-
done()
|
|
106
|
-
})
|
|
107
|
+
this.plugin.get_plain_passwd('test', (pass) => {
|
|
108
|
+
assert.equal(pass, 'testpass')
|
|
109
|
+
done()
|
|
110
|
+
})
|
|
107
111
|
})
|
|
108
112
|
})
|
|
109
113
|
|
|
@@ -111,24 +115,24 @@ describe('auth_base', () => {
|
|
|
111
115
|
beforeEach(_set_up)
|
|
112
116
|
|
|
113
117
|
it('valid password', (done) => {
|
|
114
|
-
this.plugin.check_plain_passwd(this.connection, 'test', 'testpass', pass => {
|
|
115
|
-
assert.equal(pass, true)
|
|
116
|
-
done()
|
|
117
|
-
})
|
|
118
|
+
this.plugin.check_plain_passwd(this.connection, 'test', 'testpass', (pass) => {
|
|
119
|
+
assert.equal(pass, true)
|
|
120
|
+
done()
|
|
121
|
+
})
|
|
118
122
|
})
|
|
119
123
|
|
|
120
124
|
it('wrong password', (done) => {
|
|
121
|
-
this.plugin.check_plain_passwd(this.connection, 'test', 'test1pass', pass => {
|
|
122
|
-
assert.equal(pass, false)
|
|
123
|
-
done()
|
|
124
|
-
})
|
|
125
|
+
this.plugin.check_plain_passwd(this.connection, 'test', 'test1pass', (pass) => {
|
|
126
|
+
assert.equal(pass, false)
|
|
127
|
+
done()
|
|
128
|
+
})
|
|
125
129
|
})
|
|
126
130
|
|
|
127
131
|
it('null password', (done) => {
|
|
128
|
-
this.plugin.check_plain_passwd(this.connection, 'test', null, pass => {
|
|
129
|
-
assert.equal(pass, false)
|
|
130
|
-
done()
|
|
131
|
-
})
|
|
132
|
+
this.plugin.check_plain_passwd(this.connection, 'test', null, (pass) => {
|
|
133
|
+
assert.equal(pass, false)
|
|
134
|
+
done()
|
|
135
|
+
})
|
|
132
136
|
})
|
|
133
137
|
})
|
|
134
138
|
|
|
@@ -136,30 +140,42 @@ describe('auth_base', () => {
|
|
|
136
140
|
beforeEach(_set_up)
|
|
137
141
|
|
|
138
142
|
it('no auth methods yield no result', (done) => {
|
|
139
|
-
this.plugin.select_auth_method(
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
143
|
+
this.plugin.select_auth_method(
|
|
144
|
+
(code) => {
|
|
145
|
+
assert.equal(code, null)
|
|
146
|
+
assert.equal(false, this.connection.relaying)
|
|
147
|
+
done()
|
|
148
|
+
},
|
|
149
|
+
this.connection,
|
|
150
|
+
'AUTH PLAIN',
|
|
151
|
+
)
|
|
144
152
|
})
|
|
145
153
|
|
|
146
154
|
it('invalid AUTH method, no result', (done) => {
|
|
147
|
-
this.connection.notes.allowed_auth_methods = ['PLAIN','LOGIN','CRAM-MD5']
|
|
148
|
-
this.plugin.select_auth_method(
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
155
|
+
this.connection.notes.allowed_auth_methods = ['PLAIN', 'LOGIN', 'CRAM-MD5']
|
|
156
|
+
this.plugin.select_auth_method(
|
|
157
|
+
(code) => {
|
|
158
|
+
assert.equal(code, null)
|
|
159
|
+
assert.equal(false, this.connection.relaying)
|
|
160
|
+
done()
|
|
161
|
+
},
|
|
162
|
+
this.connection,
|
|
163
|
+
'AUTH FOO',
|
|
164
|
+
)
|
|
153
165
|
})
|
|
154
166
|
|
|
155
167
|
it('valid AUTH method, valid attempt', (done) => {
|
|
156
|
-
const method = `PLAIN ${utils.base64('discard\0test\0testpass')}
|
|
157
|
-
this.connection.notes.allowed_auth_methods = ['PLAIN','LOGIN']
|
|
158
|
-
this.plugin.select_auth_method(
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
168
|
+
const method = `PLAIN ${utils.base64('discard\0test\0testpass')}`
|
|
169
|
+
this.connection.notes.allowed_auth_methods = ['PLAIN', 'LOGIN']
|
|
170
|
+
this.plugin.select_auth_method(
|
|
171
|
+
(code) => {
|
|
172
|
+
assert.equal(code, OK)
|
|
173
|
+
assert.ok(this.connection.relaying)
|
|
174
|
+
done()
|
|
175
|
+
},
|
|
176
|
+
this.connection,
|
|
177
|
+
method,
|
|
178
|
+
)
|
|
163
179
|
})
|
|
164
180
|
})
|
|
165
181
|
|
|
@@ -167,36 +183,52 @@ describe('auth_base', () => {
|
|
|
167
183
|
beforeEach(_set_up)
|
|
168
184
|
|
|
169
185
|
it('params type=string returns OK', (done) => {
|
|
170
|
-
this.plugin.auth_plain(
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
186
|
+
this.plugin.auth_plain(
|
|
187
|
+
(rc) => {
|
|
188
|
+
assert.equal(rc, OK)
|
|
189
|
+
assert.equal(false, this.connection.relaying)
|
|
190
|
+
done()
|
|
191
|
+
},
|
|
192
|
+
this.connection,
|
|
193
|
+
'AUTH FOO',
|
|
194
|
+
)
|
|
175
195
|
})
|
|
176
196
|
|
|
177
197
|
it('params type=empty array, returns OK', (done) => {
|
|
178
|
-
this.plugin.auth_plain(
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
198
|
+
this.plugin.auth_plain(
|
|
199
|
+
(rc) => {
|
|
200
|
+
assert.equal(rc, OK)
|
|
201
|
+
assert.equal(false, this.connection.relaying)
|
|
202
|
+
done()
|
|
203
|
+
},
|
|
204
|
+
this.connection,
|
|
205
|
+
[],
|
|
206
|
+
)
|
|
183
207
|
})
|
|
184
208
|
|
|
185
209
|
it('params type=array, successful auth', (done) => {
|
|
186
|
-
const method = utils.base64('discard\0test\0testpass')
|
|
187
|
-
this.plugin.auth_plain(
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
210
|
+
const method = utils.base64('discard\0test\0testpass')
|
|
211
|
+
this.plugin.auth_plain(
|
|
212
|
+
(rc) => {
|
|
213
|
+
assert.equal(rc, OK)
|
|
214
|
+
assert.ok(this.connection.relaying)
|
|
215
|
+
done()
|
|
216
|
+
},
|
|
217
|
+
this.connection,
|
|
218
|
+
[method],
|
|
219
|
+
)
|
|
192
220
|
})
|
|
193
221
|
|
|
194
222
|
it('params type=with two line login', (done) => {
|
|
195
|
-
this.plugin.auth_plain(
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
223
|
+
this.plugin.auth_plain(
|
|
224
|
+
(rc) => {
|
|
225
|
+
assert.equal(this.connection.notes.auth_plain_asked_login, true)
|
|
226
|
+
assert.equal(rc, OK)
|
|
227
|
+
done()
|
|
228
|
+
},
|
|
229
|
+
this.connection,
|
|
230
|
+
'',
|
|
231
|
+
)
|
|
200
232
|
})
|
|
201
233
|
})
|
|
202
234
|
|
|
@@ -204,23 +236,33 @@ describe('auth_base', () => {
|
|
|
204
236
|
beforeEach(_set_up_2)
|
|
205
237
|
|
|
206
238
|
it('bad auth', (done) => {
|
|
207
|
-
const credentials = ['matt','ttam']
|
|
208
|
-
this.plugin.check_user(
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
239
|
+
const credentials = ['matt', 'ttam']
|
|
240
|
+
this.plugin.check_user(
|
|
241
|
+
(code) => {
|
|
242
|
+
assert.equal(code, OK)
|
|
243
|
+
assert.equal(this.connection.relaying, false)
|
|
244
|
+
assert.equal(this.connection.notes.auth_custom_note, 'custom_note')
|
|
245
|
+
done()
|
|
246
|
+
},
|
|
247
|
+
this.connection,
|
|
248
|
+
credentials,
|
|
249
|
+
'PLAIN',
|
|
250
|
+
)
|
|
214
251
|
})
|
|
215
252
|
|
|
216
253
|
it('good auth', (done) => {
|
|
217
|
-
const credentials = ['test','testpass']
|
|
218
|
-
this.plugin.check_user(
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
254
|
+
const credentials = ['test', 'testpass']
|
|
255
|
+
this.plugin.check_user(
|
|
256
|
+
(code) => {
|
|
257
|
+
assert.equal(code, OK)
|
|
258
|
+
assert.ok(this.connection.relaying)
|
|
259
|
+
assert.equal(this.connection.notes.auth_custom_note, 'custom_note')
|
|
260
|
+
done()
|
|
261
|
+
},
|
|
262
|
+
this.connection,
|
|
263
|
+
credentials,
|
|
264
|
+
'PLAIN',
|
|
265
|
+
)
|
|
224
266
|
})
|
|
225
267
|
})
|
|
226
268
|
|
|
@@ -228,57 +270,87 @@ describe('auth_base', () => {
|
|
|
228
270
|
beforeEach(_set_up_custom_pwcb_opts)
|
|
229
271
|
|
|
230
272
|
it('legacyok_nomessage', (done) => {
|
|
231
|
-
this.plugin.check_user(
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
273
|
+
this.plugin.check_user(
|
|
274
|
+
(code, msg) => {
|
|
275
|
+
assert.equal(code, OK)
|
|
276
|
+
assert.equal(this.connection.relaying, true)
|
|
277
|
+
assert.deepEqual(this.connection.notes.resp_strings, [[235, '2.7.0 Authentication successful']])
|
|
278
|
+
done()
|
|
279
|
+
},
|
|
280
|
+
this.connection,
|
|
281
|
+
['legacyok_nomessage', 'any'],
|
|
282
|
+
'PLAIN',
|
|
283
|
+
)
|
|
237
284
|
})
|
|
238
285
|
|
|
239
286
|
it('legacyfail_nomessage', (done) => {
|
|
240
|
-
this.plugin.check_user(
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
287
|
+
this.plugin.check_user(
|
|
288
|
+
(code, msg) => {
|
|
289
|
+
assert.equal(code, OK)
|
|
290
|
+
assert.equal(this.connection.relaying, false)
|
|
291
|
+
assert.deepEqual(this.connection.notes.resp_strings, [[535, '5.7.8 Authentication failed']])
|
|
292
|
+
done()
|
|
293
|
+
},
|
|
294
|
+
this.connection,
|
|
295
|
+
['legacyfail_nomessage', 'any'],
|
|
296
|
+
'PLAIN',
|
|
297
|
+
)
|
|
246
298
|
})
|
|
247
299
|
|
|
248
300
|
it('legacyok_message', (done) => {
|
|
249
|
-
this.plugin.check_user(
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
301
|
+
this.plugin.check_user(
|
|
302
|
+
(code, msg) => {
|
|
303
|
+
assert.equal(code, OK)
|
|
304
|
+
assert.equal(this.connection.relaying, true)
|
|
305
|
+
assert.deepEqual(this.connection.notes.resp_strings, [[235, 'GREAT SUCCESS']])
|
|
306
|
+
done()
|
|
307
|
+
},
|
|
308
|
+
this.connection,
|
|
309
|
+
['legacyok_message', 'any'],
|
|
310
|
+
'PLAIN',
|
|
311
|
+
)
|
|
255
312
|
})
|
|
256
313
|
|
|
257
314
|
it('legacyfail_message', (done) => {
|
|
258
|
-
this.plugin.check_user(
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
315
|
+
this.plugin.check_user(
|
|
316
|
+
(code, msg) => {
|
|
317
|
+
assert.equal(code, OK)
|
|
318
|
+
assert.equal(this.connection.relaying, false)
|
|
319
|
+
assert.deepEqual(this.connection.notes.resp_strings, [[535, 'FAIL 123']])
|
|
320
|
+
done()
|
|
321
|
+
},
|
|
322
|
+
this.connection,
|
|
323
|
+
['legacyfail_message', 'any'],
|
|
324
|
+
'PLAIN',
|
|
325
|
+
)
|
|
264
326
|
})
|
|
265
327
|
|
|
266
328
|
it('newok', (done) => {
|
|
267
|
-
this.plugin.check_user(
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
329
|
+
this.plugin.check_user(
|
|
330
|
+
(code, msg) => {
|
|
331
|
+
assert.equal(code, OK)
|
|
332
|
+
assert.equal(this.connection.relaying, true)
|
|
333
|
+
assert.deepEqual(this.connection.notes.resp_strings, [[215, 'KOKOKO']])
|
|
334
|
+
done()
|
|
335
|
+
},
|
|
336
|
+
this.connection,
|
|
337
|
+
['newok', 'any'],
|
|
338
|
+
'PLAIN',
|
|
339
|
+
)
|
|
273
340
|
})
|
|
274
341
|
|
|
275
342
|
it('newfail', (done) => {
|
|
276
|
-
this.plugin.check_user(
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
343
|
+
this.plugin.check_user(
|
|
344
|
+
(code, msg) => {
|
|
345
|
+
assert.equal(code, OK)
|
|
346
|
+
assert.equal(this.connection.relaying, false)
|
|
347
|
+
assert.deepEqual(this.connection.notes.resp_strings, [[555, 'OHOHOH']])
|
|
348
|
+
done()
|
|
349
|
+
},
|
|
350
|
+
this.connection,
|
|
351
|
+
['newfail', 'any'],
|
|
352
|
+
'PLAIN',
|
|
353
|
+
)
|
|
282
354
|
})
|
|
283
355
|
})
|
|
284
356
|
|
|
@@ -286,31 +358,46 @@ describe('auth_base', () => {
|
|
|
286
358
|
beforeEach(_set_up_2)
|
|
287
359
|
|
|
288
360
|
it('bad auth: no notes should be set', (done) => {
|
|
289
|
-
const credentials = ['matt','ttam']
|
|
290
|
-
this.plugin.check_user(
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
361
|
+
const credentials = ['matt', 'ttam']
|
|
362
|
+
this.plugin.check_user(
|
|
363
|
+
(code) => {
|
|
364
|
+
assert.equal(this.connection.notes.auth_user, undefined)
|
|
365
|
+
assert.equal(this.connection.notes.auth_passwd, undefined)
|
|
366
|
+
done()
|
|
367
|
+
},
|
|
368
|
+
this.connection,
|
|
369
|
+
credentials,
|
|
370
|
+
'PLAIN',
|
|
371
|
+
)
|
|
295
372
|
})
|
|
296
373
|
|
|
297
374
|
it('good auth: dont store password', (done) => {
|
|
298
|
-
const creds = ['test','testpass']
|
|
299
|
-
this.plugin.blankout_password = true
|
|
300
|
-
this.plugin.check_user(
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
375
|
+
const creds = ['test', 'testpass']
|
|
376
|
+
this.plugin.blankout_password = true
|
|
377
|
+
this.plugin.check_user(
|
|
378
|
+
(code) => {
|
|
379
|
+
assert.equal(this.connection.notes.auth_user, creds[0])
|
|
380
|
+
assert.equal(this.connection.notes.auth_passwd, undefined)
|
|
381
|
+
done()
|
|
382
|
+
},
|
|
383
|
+
this.connection,
|
|
384
|
+
creds,
|
|
385
|
+
'PLAIN',
|
|
386
|
+
)
|
|
305
387
|
})
|
|
306
388
|
|
|
307
389
|
it('good auth: store password (default)', (done) => {
|
|
308
|
-
const creds = ['test','testpass']
|
|
309
|
-
this.plugin.check_user(
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
390
|
+
const creds = ['test', 'testpass']
|
|
391
|
+
this.plugin.check_user(
|
|
392
|
+
(code) => {
|
|
393
|
+
assert.equal(this.connection.notes.auth_user, creds[0])
|
|
394
|
+
assert.equal(this.connection.notes.auth_passwd, creds[1])
|
|
395
|
+
done()
|
|
396
|
+
},
|
|
397
|
+
this.connection,
|
|
398
|
+
creds,
|
|
399
|
+
'PLAIN',
|
|
400
|
+
)
|
|
314
401
|
})
|
|
315
402
|
})
|
|
316
403
|
|
|
@@ -318,34 +405,46 @@ describe('auth_base', () => {
|
|
|
318
405
|
beforeEach(_set_up)
|
|
319
406
|
|
|
320
407
|
it('AUTH type FOO', (done) => {
|
|
321
|
-
const params = ['AUTH','FOO']
|
|
322
|
-
this.connection.notes.allowed_auth_methods = ['PLAIN','LOGIN']
|
|
323
|
-
this.plugin.hook_unrecognized_command(
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
408
|
+
const params = ['AUTH', 'FOO']
|
|
409
|
+
this.connection.notes.allowed_auth_methods = ['PLAIN', 'LOGIN']
|
|
410
|
+
this.plugin.hook_unrecognized_command(
|
|
411
|
+
(code) => {
|
|
412
|
+
assert.equal(code, null)
|
|
413
|
+
assert.equal(this.connection.relaying, false)
|
|
414
|
+
done()
|
|
415
|
+
},
|
|
416
|
+
this.connection,
|
|
417
|
+
params,
|
|
418
|
+
)
|
|
328
419
|
})
|
|
329
420
|
|
|
330
421
|
it('AUTH PLAIN', (done) => {
|
|
331
|
-
const params = ['AUTH','PLAIN', utils.base64('discard\0test\0testpass')]
|
|
332
|
-
this.connection.notes.allowed_auth_methods = ['PLAIN','LOGIN']
|
|
333
|
-
this.plugin.hook_unrecognized_command(
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
422
|
+
const params = ['AUTH', 'PLAIN', utils.base64('discard\0test\0testpass')]
|
|
423
|
+
this.connection.notes.allowed_auth_methods = ['PLAIN', 'LOGIN']
|
|
424
|
+
this.plugin.hook_unrecognized_command(
|
|
425
|
+
(code) => {
|
|
426
|
+
assert.equal(code, OK)
|
|
427
|
+
assert.ok(this.connection.relaying)
|
|
428
|
+
done()
|
|
429
|
+
},
|
|
430
|
+
this.connection,
|
|
431
|
+
params,
|
|
432
|
+
)
|
|
338
433
|
})
|
|
339
434
|
|
|
340
435
|
it('AUTH PLAIN, authenticating', (done) => {
|
|
341
|
-
this.connection.notes.allowed_auth_methods = ['PLAIN','LOGIN']
|
|
342
|
-
this.connection.notes.authenticating=true
|
|
343
|
-
this.connection.notes.auth_method='PLAIN'
|
|
344
|
-
this.plugin.hook_unrecognized_command(
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
436
|
+
this.connection.notes.allowed_auth_methods = ['PLAIN', 'LOGIN']
|
|
437
|
+
this.connection.notes.authenticating = true
|
|
438
|
+
this.connection.notes.auth_method = 'PLAIN'
|
|
439
|
+
this.plugin.hook_unrecognized_command(
|
|
440
|
+
(code) => {
|
|
441
|
+
assert.equal(code, OK)
|
|
442
|
+
assert.ok(this.connection.relaying)
|
|
443
|
+
done()
|
|
444
|
+
},
|
|
445
|
+
this.connection,
|
|
446
|
+
[utils.base64('discard\0test\0testpass')],
|
|
447
|
+
)
|
|
349
448
|
})
|
|
350
449
|
})
|
|
351
450
|
|
|
@@ -353,83 +452,122 @@ describe('auth_base', () => {
|
|
|
353
452
|
beforeEach(_set_up)
|
|
354
453
|
|
|
355
454
|
it('AUTH LOGIN', (done) => {
|
|
356
|
-
const params = ['AUTH','LOGIN']
|
|
357
|
-
this.connection.notes.allowed_auth_methods = ['PLAIN','LOGIN']
|
|
358
|
-
this.plugin.hook_unrecognized_command(
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
455
|
+
const params = ['AUTH', 'LOGIN']
|
|
456
|
+
this.connection.notes.allowed_auth_methods = ['PLAIN', 'LOGIN']
|
|
457
|
+
this.plugin.hook_unrecognized_command(
|
|
458
|
+
(code) => {
|
|
459
|
+
assert.equal(code, OK)
|
|
460
|
+
assert.equal(this.connection.relaying, false)
|
|
461
|
+
assert.equal(this.connection.notes.auth_login_asked_login, true)
|
|
462
|
+
|
|
463
|
+
this.plugin.hook_unrecognized_command(
|
|
464
|
+
(code) => {
|
|
465
|
+
assert.equal(code, OK)
|
|
466
|
+
assert.equal(this.connection.notes.auth_login_userlogin, 'test')
|
|
467
|
+
assert.equal(this.connection.relaying, false)
|
|
468
|
+
this.plugin.hook_unrecognized_command(
|
|
469
|
+
(code) => {
|
|
470
|
+
assert.equal(code, OK)
|
|
471
|
+
assert.equal(this.connection.relaying, true)
|
|
472
|
+
done()
|
|
473
|
+
},
|
|
474
|
+
this.connection,
|
|
475
|
+
[utils.base64('testpass')],
|
|
476
|
+
)
|
|
477
|
+
},
|
|
478
|
+
this.connection,
|
|
479
|
+
[utils.base64('test')],
|
|
480
|
+
)
|
|
481
|
+
},
|
|
482
|
+
this.connection,
|
|
483
|
+
params,
|
|
484
|
+
)
|
|
374
485
|
})
|
|
375
486
|
|
|
376
487
|
it('AUTH LOGIN <username>', (done) => {
|
|
377
|
-
const params = ['AUTH','LOGIN', utils.base64('test')]
|
|
378
|
-
this.connection.notes.allowed_auth_methods = ['PLAIN','LOGIN']
|
|
379
|
-
this.plugin.hook_unrecognized_command(
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
488
|
+
const params = ['AUTH', 'LOGIN', utils.base64('test')]
|
|
489
|
+
this.connection.notes.allowed_auth_methods = ['PLAIN', 'LOGIN']
|
|
490
|
+
this.plugin.hook_unrecognized_command(
|
|
491
|
+
(code) => {
|
|
492
|
+
assert.equal(code, OK)
|
|
493
|
+
assert.equal(this.connection.relaying, false)
|
|
494
|
+
assert.equal(this.connection.notes.auth_login_userlogin, 'test')
|
|
495
|
+
assert.equal(this.connection.notes.auth_login_asked_login, true)
|
|
496
|
+
|
|
497
|
+
this.plugin.hook_unrecognized_command(
|
|
498
|
+
(code2) => {
|
|
499
|
+
assert.equal(code2, OK)
|
|
500
|
+
assert.equal(this.connection.relaying, true)
|
|
501
|
+
done()
|
|
502
|
+
},
|
|
503
|
+
this.connection,
|
|
504
|
+
[utils.base64('testpass')],
|
|
505
|
+
)
|
|
506
|
+
},
|
|
507
|
+
this.connection,
|
|
508
|
+
params,
|
|
509
|
+
)
|
|
391
510
|
})
|
|
392
511
|
|
|
393
512
|
it('AUTH LOGIN <username>, bad protocol', (done) => {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
this.
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
513
|
+
const params = ['AUTH', 'LOGIN', utils.base64('test')]
|
|
514
|
+
this.connection.notes.allowed_auth_methods = ['PLAIN', 'LOGIN']
|
|
515
|
+
this.plugin.hook_unrecognized_command(
|
|
516
|
+
(code) => {
|
|
517
|
+
assert.equal(code, OK)
|
|
518
|
+
assert.equal(this.connection.relaying, false)
|
|
519
|
+
assert.equal(this.connection.notes.auth_login_userlogin, 'test')
|
|
520
|
+
assert.equal(this.connection.notes.auth_login_asked_login, true)
|
|
521
|
+
|
|
522
|
+
this.plugin.hook_unrecognized_command(
|
|
523
|
+
(code, msg) => {
|
|
524
|
+
assert.equal(code, DENYDISCONNECT)
|
|
525
|
+
assert.equal(msg, 'bad protocol')
|
|
526
|
+
assert.equal(this.connection.relaying, false)
|
|
527
|
+
done()
|
|
528
|
+
},
|
|
529
|
+
this.connection,
|
|
530
|
+
['AUTH', 'LOGIN'],
|
|
531
|
+
)
|
|
532
|
+
},
|
|
533
|
+
this.connection,
|
|
534
|
+
params,
|
|
535
|
+
)
|
|
410
536
|
})
|
|
411
537
|
|
|
412
538
|
it('AUTH LOGIN, reauthentication', (done) => {
|
|
413
|
-
const params = ['AUTH','LOGIN', utils.base64('test')]
|
|
414
|
-
this.connection.notes.allowed_auth_methods = ['PLAIN','LOGIN']
|
|
415
|
-
this.plugin.hook_unrecognized_command(
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
539
|
+
const params = ['AUTH', 'LOGIN', utils.base64('test')]
|
|
540
|
+
this.connection.notes.allowed_auth_methods = ['PLAIN', 'LOGIN']
|
|
541
|
+
this.plugin.hook_unrecognized_command(
|
|
542
|
+
(code) => {
|
|
543
|
+
assert.equal(code, OK)
|
|
544
|
+
assert.equal(this.connection.relaying, false)
|
|
545
|
+
assert.equal(this.connection.notes.auth_login_userlogin, 'test')
|
|
546
|
+
assert.equal(this.connection.notes.auth_login_asked_login, true)
|
|
547
|
+
|
|
548
|
+
this.plugin.hook_unrecognized_command(
|
|
549
|
+
(code) => {
|
|
550
|
+
assert.equal(code, OK)
|
|
551
|
+
assert.equal(this.connection.relaying, true)
|
|
552
|
+
assert.equal(this.connection.notes.auth_login_userlogin, null)
|
|
553
|
+
assert.equal(this.connection.notes.auth_login_asked_login, false)
|
|
554
|
+
|
|
555
|
+
this.plugin.hook_unrecognized_command(
|
|
556
|
+
(code) => {
|
|
557
|
+
assert.equal(code, OK)
|
|
558
|
+
done()
|
|
559
|
+
},
|
|
560
|
+
this.connection,
|
|
561
|
+
['AUTH', 'LOGIN'],
|
|
562
|
+
)
|
|
563
|
+
},
|
|
564
|
+
this.connection,
|
|
565
|
+
[utils.base64('testpass')],
|
|
566
|
+
)
|
|
567
|
+
},
|
|
568
|
+
this.connection,
|
|
569
|
+
params,
|
|
570
|
+
)
|
|
433
571
|
})
|
|
434
572
|
})
|
|
435
573
|
|
|
@@ -437,8 +575,8 @@ describe('auth_base', () => {
|
|
|
437
575
|
beforeEach(_set_up)
|
|
438
576
|
|
|
439
577
|
it('hexi', () => {
|
|
440
|
-
assert.equal(this.plugin.hexi(512), 200)
|
|
441
|
-
assert.equal(this.plugin.hexi(8), 8)
|
|
578
|
+
assert.equal(this.plugin.hexi(512), 200)
|
|
579
|
+
assert.equal(this.plugin.hexi(8), 8)
|
|
442
580
|
})
|
|
443
581
|
})
|
|
444
582
|
|
|
@@ -447,10 +585,11 @@ describe('auth_base', () => {
|
|
|
447
585
|
|
|
448
586
|
it('constrain_sender, domain match', (done) => {
|
|
449
587
|
this.mfrom = new Address('user@example.com')
|
|
450
|
-
this.connection.results.add({name: 'auth'}, { user: 'user@example.com' })
|
|
451
|
-
this.plugin.constrain_sender(
|
|
588
|
+
this.connection.results.add({ name: 'auth' }, { user: 'user@example.com' })
|
|
589
|
+
this.plugin.constrain_sender(
|
|
590
|
+
(resCode) => {
|
|
452
591
|
assert.equal(resCode, undefined)
|
|
453
|
-
done()
|
|
592
|
+
done()
|
|
454
593
|
},
|
|
455
594
|
this.connection,
|
|
456
595
|
[this.mfrom],
|
|
@@ -459,11 +598,12 @@ describe('auth_base', () => {
|
|
|
459
598
|
|
|
460
599
|
it('constrain_sender, domain mismatch', (done) => {
|
|
461
600
|
this.mfrom = new Address('user@example.net')
|
|
462
|
-
this.connection.results.add({name: 'auth'}, { user: 'user@example.com' })
|
|
463
|
-
this.plugin.constrain_sender(
|
|
601
|
+
this.connection.results.add({ name: 'auth' }, { user: 'user@example.com' })
|
|
602
|
+
this.plugin.constrain_sender(
|
|
603
|
+
(resCode, denyMsg) => {
|
|
464
604
|
assert.equal(resCode, DENY)
|
|
465
605
|
assert.ok(denyMsg)
|
|
466
|
-
done()
|
|
606
|
+
done()
|
|
467
607
|
},
|
|
468
608
|
this.connection,
|
|
469
609
|
[this.mfrom],
|
|
@@ -471,10 +611,11 @@ describe('auth_base', () => {
|
|
|
471
611
|
})
|
|
472
612
|
it('constrain_sender, no domain', (done) => {
|
|
473
613
|
this.mfrom = new Address('user@example.com')
|
|
474
|
-
this.connection.results.add({name: 'auth'}, { user: 'user' })
|
|
475
|
-
this.plugin.constrain_sender(
|
|
614
|
+
this.connection.results.add({ name: 'auth' }, { user: 'user' })
|
|
615
|
+
this.plugin.constrain_sender(
|
|
616
|
+
(resCode) => {
|
|
476
617
|
assert.equal(resCode, undefined)
|
|
477
|
-
done()
|
|
618
|
+
done()
|
|
478
619
|
},
|
|
479
620
|
this.connection,
|
|
480
621
|
[this.mfrom],
|