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
package/docs/Tutorial.md
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
Writing Haraka Plugins
|
|
2
|
-
======================
|
|
1
|
+
# Writing Haraka Plugins
|
|
3
2
|
|
|
4
3
|
Part of the joy of using Haraka as your main mail server is having a strong
|
|
5
4
|
plugin based system which means you control all aspects of how your mail is
|
|
@@ -13,11 +12,10 @@ Node.js) and the world is your oyster.
|
|
|
13
12
|
|
|
14
13
|
This tutorial will run through a simple plugin which allows you to have
|
|
15
14
|
email addresses that expire in a short period of time. This is handy if you
|
|
16
|
-
want a
|
|
15
|
+
want a _disposable email address_ to use to sign up for a web site that you
|
|
17
16
|
don't wish to continually receive communication from.
|
|
18
17
|
|
|
19
|
-
The Design
|
|
20
|
-
----------
|
|
18
|
+
## The Design
|
|
21
19
|
|
|
22
20
|
In order to make this simple, we are going to simply let you have tagged
|
|
23
21
|
email addresses such as `user-20120515@domain.com` which will expire on the
|
|
@@ -26,19 +24,17 @@ reject mails to that address after the expiry date. If the address hasn't
|
|
|
26
24
|
expired yet it will re-write the address to `user@domain.com` before onward
|
|
27
25
|
delivery.
|
|
28
26
|
|
|
29
|
-
What You Will Need
|
|
30
|
-
------------------
|
|
27
|
+
## What You Will Need
|
|
31
28
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
- Node.js and npm
|
|
30
|
+
- Haraka
|
|
31
|
+
- A text editor
|
|
32
|
+
- [swaks][1]
|
|
33
|
+
- A screwdriver
|
|
37
34
|
|
|
38
35
|
[1]: http://jetmore.org/john/code/swaks/
|
|
39
36
|
|
|
40
|
-
Getting Started
|
|
41
|
-
---------------
|
|
37
|
+
## Getting Started
|
|
42
38
|
|
|
43
39
|
First install Haraka via npm if you haven't already:
|
|
44
40
|
|
|
@@ -57,56 +53,48 @@ Next, let's create a new plugin:
|
|
|
57
53
|
This should output a bunch of information about files it has created:
|
|
58
54
|
|
|
59
55
|
Plugin rcpt_to.disposable created
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
56
|
+
Now edit javascript in: /path/to/new_project/plugins/rcpt_to.disposable.js
|
|
57
|
+
Add the plugin to config: /path/to/new_project/config/plugins
|
|
58
|
+
And edit documentation in: /path/to/new_project/docs/plugins/rcpt_to.disposable.md
|
|
63
59
|
|
|
64
|
-
So let's do the second part now - load up the `config/plugins` file and
|
|
65
|
-
set
|
|
60
|
+
So let's do the second part now - load up the `config/plugins` file and
|
|
61
|
+
set it up to test. Comment out most of the plugins, except for
|
|
66
62
|
`rcpt_to.in_host_list` and add in our new plugin, and change the queue
|
|
67
63
|
plugin to `test_queue`. The final file should look like this:
|
|
68
64
|
|
|
69
|
-
|
|
65
|
+
# default list of plugins
|
|
70
66
|
|
|
71
|
-
|
|
72
|
-
|
|
67
|
+
#dns-lists
|
|
68
|
+
#data.signatures
|
|
73
69
|
|
|
74
|
-
|
|
75
|
-
|
|
70
|
+
# block mail from some known bad HELOs - see config/helo.checks.ini for configuration
|
|
71
|
+
#helo.checks
|
|
76
72
|
|
|
77
|
-
|
|
78
|
-
|
|
73
|
+
# Only accept mail where the MAIL FROM domain is resolvable to an MX record
|
|
74
|
+
#mail_from.is_resolvable
|
|
79
75
|
|
|
80
|
-
|
|
81
|
-
|
|
76
|
+
# Allow dated tagged addresses
|
|
77
|
+
rcpt_to.disposable
|
|
82
78
|
|
|
83
|
-
|
|
84
|
-
|
|
79
|
+
# Only accept mail for your personal list of hosts
|
|
80
|
+
rcpt_to.in_host_list
|
|
85
81
|
|
|
86
|
-
|
|
87
|
-
|
|
82
|
+
# Queue mail via qmail-queue
|
|
83
|
+
#queue/qmail-queue
|
|
88
84
|
|
|
89
|
-
|
|
90
|
-
rcpt_to.in_host_list
|
|
85
|
+
test_queue
|
|
91
86
|
|
|
92
|
-
|
|
93
|
-
#queue/qmail-queue
|
|
87
|
+
The ordering here is important - our new plugin has to come before `rcpt_to.in_host_list`.
|
|
94
88
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
Remember that the ordering here is important - our new plugin has to come
|
|
98
|
-
before `rcpt_to.in_host_list`.
|
|
99
|
-
|
|
100
|
-
Now fire up your favourite editor and put the following into
|
|
101
|
-
the `plugins/rcpt_to.disposable.js` file:
|
|
89
|
+
Fire up your favourite editor and put the following into the `plugins/rcpt_to.disposable.js` file:
|
|
102
90
|
|
|
103
91
|
exports.hook_rcpt = function (next, connection, params) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
92
|
+
const rcpt = params[0];
|
|
93
|
+
this.loginfo("Got recipient: " + rcpt);
|
|
94
|
+
next();
|
|
95
|
+
}
|
|
108
96
|
|
|
109
|
-
|
|
97
|
+
Here we log that we got the recipient.
|
|
110
98
|
|
|
111
99
|
Check this works. You'll need two terminal windows. In window 1:
|
|
112
100
|
|
|
@@ -126,29 +114,28 @@ In the logs you should see:
|
|
|
126
114
|
Which indicates everything is working. You should also have a file
|
|
127
115
|
`/tmp/mail.eml` containing the email that swaks sent.
|
|
128
116
|
|
|
129
|
-
Parsing Out The Date
|
|
130
|
-
--------------------
|
|
117
|
+
## Parsing Out The Date
|
|
131
118
|
|
|
132
|
-
Now
|
|
119
|
+
Now check for emails with an expire date in them and turn them into
|
|
133
120
|
`Date` objects. Edit your plugin file as follows:
|
|
134
121
|
|
|
135
122
|
exports.hook_rcpt = function (next, connection, params) {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
123
|
+
var rcpt = params[0];
|
|
124
|
+
this.loginfo("Got recipient: " + rcpt);
|
|
125
|
+
|
|
126
|
+
// Check user matches regex 'user-YYYYMMDD':
|
|
127
|
+
var match = /^(.*)-(\d{4})(\d{2})(\d{2})$/.exec(rcpt.user);
|
|
128
|
+
if (!match) {
|
|
129
|
+
return next();
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// get date - note Date constructor takes month-1 (i.e. Dec == 11).
|
|
133
|
+
var expiry_date = new Date(match[2], match[3]-1, match[4]);
|
|
134
|
+
|
|
135
|
+
this.loginfo("Email expires on: " + expiry_date);
|
|
136
|
+
|
|
137
|
+
next();
|
|
138
|
+
}
|
|
152
139
|
|
|
153
140
|
Start haraka again and pass it the following email via swaks:
|
|
154
141
|
|
|
@@ -163,61 +150,59 @@ And you should see now in the logs:
|
|
|
163
150
|
The exact time may vary depending on your timezone, but it should be obvious
|
|
164
151
|
we now have a date object, which we can now compare to the current date.
|
|
165
152
|
|
|
166
|
-
Rejecting Expired Emails
|
|
167
|
-
------------------------
|
|
153
|
+
## Rejecting Expired Emails
|
|
168
154
|
|
|
169
155
|
The next edit we have to do is to add in code to compare to the current date
|
|
170
156
|
and reject expired emails. Again, this is very simple:
|
|
171
157
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
158
|
+
exports.hook_rcpt = function (next, connection, params) {
|
|
159
|
+
var rcpt = params[0];
|
|
160
|
+
this.loginfo("Got recipient: " + rcpt);
|
|
161
|
+
|
|
162
|
+
// Check user matches regex 'user-YYYYMMDD':
|
|
163
|
+
var match = /^(.*)-(\d{4})(\d{2})(\d{2})$/.exec(rcpt.user);
|
|
164
|
+
if (!match) {
|
|
165
|
+
return next();
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// get date - note Date constructor takes month-1 (i.e. Dec == 11).
|
|
169
|
+
var expiry_date = new Date(match[2], match[3]-1, match[4]);
|
|
170
|
+
|
|
171
|
+
this.loginfo("Email expires on: " + expiry_date);
|
|
172
|
+
|
|
173
|
+
var today = new Date();
|
|
174
|
+
|
|
175
|
+
if (expiry_date < today) {
|
|
176
|
+
// If we get here, the email address has expired
|
|
177
|
+
return next(DENY, "Expired email address");
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
next();
|
|
181
|
+
}
|
|
196
182
|
|
|
197
183
|
And we can easily check that with swaks (remember to restart Haraka):
|
|
198
184
|
|
|
199
185
|
$ swaks -h foo.com -t booya-20110101@haraka.local -f somewhere@example.com \
|
|
200
186
|
-s localhost -p 25
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
187
|
+
=== Trying localhost:25...
|
|
188
|
+
=== Connected to localhost.
|
|
189
|
+
<- 220 sergeant.org ESMTP Haraka 0.3 ready
|
|
190
|
+
-> EHLO foo.com
|
|
191
|
+
<- 250-Haraka says hi Unknown [127.0.0.1]
|
|
192
|
+
<- 250-PIPELINING
|
|
193
|
+
<- 250-8BITMIME
|
|
194
|
+
<- 250 SIZE 500000
|
|
195
|
+
-> MAIL FROM:<somewhere@example.com>
|
|
196
|
+
<- 250 From address is OK
|
|
197
|
+
-> RCPT TO:<booya-20110101@haraka.local>
|
|
198
|
+
<** 550 Expired email address
|
|
199
|
+
-> QUIT
|
|
200
|
+
<- 221 closing connection. Have a jolly good day.
|
|
201
|
+
=== Connection closed with remote host.
|
|
216
202
|
|
|
217
203
|
Now we need to do one more thing...
|
|
218
204
|
|
|
219
|
-
Fixing Up Unexpired Emails
|
|
220
|
-
--------------------------
|
|
205
|
+
## Fixing Up Unexpired Emails
|
|
221
206
|
|
|
222
207
|
The last thing we need to do, is if we have an email that isn't expired, we
|
|
223
208
|
need to normalise it back to the real email address, because wherever we
|
|
@@ -225,34 +210,34 @@ deliver this to is unlikely to recognise these new email addresses.
|
|
|
225
210
|
|
|
226
211
|
Here's how our final plugin will look:
|
|
227
212
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
213
|
+
exports.hook_rcpt = function (next, connection, params) {
|
|
214
|
+
var rcpt = params[0];
|
|
215
|
+
this.loginfo("Got recipient: " + rcpt);
|
|
216
|
+
|
|
217
|
+
// Check user matches regex 'user-YYYYMMDD':
|
|
218
|
+
var match = /^(.*)-(\d{4})(\d{2})(\d{2})$/.exec(rcpt.user);
|
|
219
|
+
if (!match) {
|
|
220
|
+
return next();
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// get date - note Date constructor takes month-1 (i.e. Dec == 11).
|
|
224
|
+
var expiry_date = new Date(match[2], match[3]-1, match[4]);
|
|
225
|
+
|
|
226
|
+
this.loginfo("Email expires on: " + expiry_date);
|
|
227
|
+
|
|
228
|
+
var today = new Date();
|
|
229
|
+
|
|
230
|
+
if (expiry_date < today) {
|
|
231
|
+
// If we get here, the email address has expired
|
|
232
|
+
return next(DENY, "Expired email address");
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// now get rid of the extension:
|
|
236
|
+
rcpt.user = match[1];
|
|
237
|
+
this.loginfo("Email address now: " + rcpt);
|
|
238
|
+
|
|
239
|
+
next();
|
|
240
|
+
}
|
|
256
241
|
|
|
257
242
|
And when we test this with an unexpired address via swaks:
|
|
258
243
|
|
|
@@ -261,14 +246,13 @@ And when we test this with an unexpired address via swaks:
|
|
|
261
246
|
|
|
262
247
|
We get in the logs:
|
|
263
248
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
249
|
+
[INFO] [rcpt_to.disposable] Got recipient: <booya-20120101@haraka.local>
|
|
250
|
+
[INFO] [rcpt_to.disposable] Email expires on: Sun Jan 01 2012 00:00:00 GMT-0500 (EST)
|
|
251
|
+
[INFO] [rcpt_to.disposable] Email address now: <booya@haraka.local>
|
|
267
252
|
|
|
268
253
|
Which indicates that we have successfully modified the email address.
|
|
269
254
|
|
|
270
|
-
Further Reading
|
|
271
|
-
===============
|
|
255
|
+
# Further Reading
|
|
272
256
|
|
|
273
257
|
There are many more features of the Haraka API to explore, including access
|
|
274
258
|
to the body of the email and the headers, access to the HELO string, and
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
backscatterer
|
|
2
|
-
=============
|
|
1
|
+
# backscatterer
|
|
3
2
|
|
|
4
3
|
This is a very basic pluign that checks the connecting IP against
|
|
5
4
|
ips.backscatterer.org when the envelope-from is null or postmaster@
|
|
6
5
|
as per the instructions at http://www.backscatterer.org/?target=usage
|
|
7
6
|
|
|
8
7
|
This plugin is used to reject misdirected bounces and autoresponders
|
|
9
|
-
and sender callouts from abusive systems which can happen when a
|
|
8
|
+
and sender callouts from abusive systems which can happen when a
|
|
10
9
|
local domain is spoofed and used as the envelope-from in a spam run.
|
|
@@ -3,60 +3,51 @@
|
|
|
3
3
|
See [haraka-plugin-access](https://github.com/haraka/haraka-plugin-access)
|
|
4
4
|
for upgrade instructions.
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
connect.rdns\_access
|
|
8
|
-
===================
|
|
9
|
-
|
|
6
|
+
# connect.rdns_access
|
|
10
7
|
|
|
11
8
|
This plugin will evaluate the remote IP address and the remote rDNS hostname
|
|
12
|
-
against a set of white and black lists.
|
|
9
|
+
against a set of white and black lists. The lists are applied in the following
|
|
13
10
|
way:
|
|
14
11
|
|
|
15
|
-
connect.
|
|
16
|
-
connect.
|
|
17
|
-
connect.
|
|
18
|
-
connect.
|
|
12
|
+
connect.rdns_access.whitelist (pass)
|
|
13
|
+
connect.rdns_access.whitelist_regex (pass)
|
|
14
|
+
connect.rdns_access.blacklist (block)
|
|
15
|
+
connect.rdns_access.blacklist_regex (block)
|
|
19
16
|
|
|
20
|
-
Configuration connect.
|
|
21
|
-
-------------------------------------
|
|
17
|
+
## Configuration connect.rdns_access.ini
|
|
22
18
|
|
|
23
19
|
General configuration file for this plugin.
|
|
24
20
|
|
|
25
|
-
|
|
21
|
+
- connect.rdns_access.general.deny_msg
|
|
26
22
|
|
|
27
23
|
Text to send the user on reject (text).
|
|
28
24
|
|
|
29
|
-
|
|
30
|
-
Configuration connect.rdns\_access.whitelist
|
|
31
|
-
-------------------------------------------
|
|
25
|
+
## Configuration connect.rdns_access.whitelist
|
|
32
26
|
|
|
33
27
|
The whitelist is mostly to counter blacklist entries that match more than
|
|
34
|
-
what one would want.
|
|
28
|
+
what one would want. This file should be used for a specific IP address
|
|
35
29
|
or rDNS hostnames, one per line, that should bypass blacklist checks.
|
|
36
30
|
NOTE: We heavily suggest tailoring blacklist entries to be as accurate as
|
|
37
|
-
possible and never using whitelists.
|
|
31
|
+
possible and never using whitelists. Nevertheless, if you need whitelists,
|
|
38
32
|
here they are.
|
|
39
33
|
|
|
40
|
-
Configuration connect.
|
|
41
|
-
-------------------------------------------------
|
|
34
|
+
## Configuration connect.rdns_access.whitelist_regex
|
|
42
35
|
|
|
43
36
|
Does the same thing as the whitelist file, but each line is a regex.
|
|
44
37
|
Each line is also anchored for you, meaning '^' + regex + '$' is added for
|
|
45
|
-
you.
|
|
46
|
-
either the start or the end of your regex.
|
|
38
|
+
you. If you need to get around this restriction, you may use a '.\*' at
|
|
39
|
+
either the start or the end of your regex. This should help prevent people
|
|
47
40
|
from writing overly permissive rules on accident.
|
|
48
41
|
|
|
49
|
-
Configuration connect.
|
|
50
|
-
-------------------------------------------
|
|
42
|
+
## Configuration connect.rdns_access.blacklist
|
|
51
43
|
|
|
52
44
|
This file should be used for a specific IP address or rDNS hostnames, one
|
|
53
45
|
per line, that should fail on connect.
|
|
54
46
|
|
|
55
|
-
Configuration connect.
|
|
56
|
-
-------------------------------------------------
|
|
47
|
+
## Configuration connect.rdns_access.blacklist_regex
|
|
57
48
|
|
|
58
49
|
Does the same thing as the blacklist file, but each line is a regex.
|
|
59
50
|
Each line is also anchored for you, meaning '^' + regex + '$' is added for
|
|
60
|
-
you.
|
|
61
|
-
either the start or the end of your regex.
|
|
51
|
+
you. If you need to get around this restriction, you may use a '.\*' at
|
|
52
|
+
either the start or the end of your regex. This should help prevent people
|
|
62
53
|
from writing overly permissive rules on accident.
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
This plugin implements the [DKIM Core specification](dkimcore.org).
|
|
4
4
|
|
|
5
|
-
This plugin only
|
|
6
|
-
|
|
5
|
+
This plugin only _signs_ outbound messages. It does not validate DKIM signatures.
|
|
7
6
|
|
|
8
7
|
## Getting Started
|
|
9
8
|
|
|
@@ -38,35 +37,32 @@ The values in the address have the following meaning:
|
|
|
38
37
|
services: s=[email]
|
|
39
38
|
keytypes: [ rsa ]
|
|
40
39
|
|
|
41
|
-
|
|
42
40
|
## Key size
|
|
43
41
|
|
|
44
42
|
The default key size created by `dkim_key_gen.sh` is 2048. That is considered secure as of mid-2014 but after 2020, you should be using 4096.
|
|
45
43
|
|
|
46
44
|
# What to sign
|
|
47
45
|
|
|
48
|
-
The DKIM signing key for messages from example.org
|
|
49
|
-
|
|
50
|
-
having an
|
|
46
|
+
The DKIM signing key for messages from example.org _should_ be signed with
|
|
47
|
+
a DKIM key for example.org. Failing to do so will result in messages not
|
|
48
|
+
having an _aligned_ DKIM signature. For DMARC enabled domains, this will
|
|
51
49
|
likely result in deliverability problems.
|
|
52
50
|
|
|
53
51
|
For correct alignment, Haraka signs each message with that domains DKIM key.
|
|
54
52
|
For an alternative, see the legacy Single Domain Configuration below.
|
|
55
53
|
|
|
56
|
-
|
|
57
54
|
# Configuration
|
|
58
55
|
|
|
59
56
|
This plugin is configured in `dkim_sign.ini`.
|
|
60
57
|
|
|
61
|
-
- disabled = [ 1 | true | yes ]
|
|
62
|
-
|
|
63
|
-
Set this to disable DKIM signing
|
|
58
|
+
- disabled = [ 1 | true | yes ] (OPTIONAL)
|
|
64
59
|
|
|
65
|
-
|
|
60
|
+
Set this to disable DKIM signing
|
|
66
61
|
|
|
67
|
-
|
|
68
|
-
The 'From' header is required by the RFC and will be added if missing.
|
|
62
|
+
- headers_to_sign = list, of; headers (REQUIRED)
|
|
69
63
|
|
|
64
|
+
Set this to the list of headers that should be signed, separated by commas, colons or semi-colons. Signing prevents tampering with the specified headers.
|
|
65
|
+
The 'From' header is required by the RFC and will be added if missing.
|
|
70
66
|
|
|
71
67
|
## Single Domain Configuration
|
|
72
68
|
|
|
@@ -74,13 +70,13 @@ To sign all messages with a single DKIM key, you must set the selector and domai
|
|
|
74
70
|
|
|
75
71
|
- selector = name
|
|
76
72
|
|
|
77
|
-
|
|
78
|
-
|
|
73
|
+
Set this to the selector name published in DNS under the
|
|
74
|
+
\_domainkey sub-domain of the domain referenced below.
|
|
79
75
|
|
|
80
76
|
- domain = name
|
|
81
77
|
|
|
82
|
-
|
|
83
|
-
|
|
78
|
+
Set this to the domain name that will be used to sign messages
|
|
79
|
+
which don't match a per-domain DKIM key. The DNS TXT entry for:
|
|
84
80
|
|
|
85
81
|
<selector>._domainkey.<domain>
|
|
86
82
|
|
|
@@ -1,36 +1,28 @@
|
|
|
1
|
-
dkim_verify
|
|
2
|
-
===========
|
|
1
|
+
# dkim_verify
|
|
3
2
|
|
|
4
3
|
This plugin will verify DKIM signatures as defined by RFC 6376 and add
|
|
5
4
|
an Authentication-Results header as appropriate.
|
|
6
5
|
|
|
6
|
+
## Configuration
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
-------------
|
|
8
|
+
- allowed_time_skew
|
|
10
9
|
|
|
11
|
-
* allowed_time_skew
|
|
12
|
-
|
|
13
10
|
How far can we stretch on time matching, in secs. Useful when clock is skewed.
|
|
14
11
|
|
|
15
|
-
|
|
12
|
+
- sigerror_log_level
|
|
16
13
|
|
|
17
|
-
|
|
14
|
+
## Testing
|
|
18
15
|
|
|
19
|
-
|
|
20
|
-
-------
|
|
21
|
-
|
|
22
|
-
This plugin also provides a command-line test tool that can be used to
|
|
16
|
+
This plugin also provides a command-line test tool that can be used to
|
|
23
17
|
debug DKIM issues or to check results.
|
|
24
18
|
|
|
25
|
-
|
|
19
|
+
```
|
|
26
20
|
# dkimverify < message
|
|
27
21
|
identity="@gmail.com" domain="gmail.com" result=pass
|
|
28
|
-
|
|
22
|
+
```
|
|
29
23
|
|
|
30
24
|
You can add `--debug` to the option arguments to see a full trace of the processing.
|
|
31
25
|
|
|
32
|
-
|
|
33
|
-
Notes
|
|
34
|
-
-----
|
|
26
|
+
## Notes
|
|
35
27
|
|
|
36
28
|
This plugin and underlying library does not currently support DKIM body length limits (l=).
|