Haraka 3.0.3 → 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.
- package/.eslintrc.yaml +5 -9
- package/.prettierrc.yml +1 -0
- package/CONTRIBUTORS.md +11 -0
- package/Changes.md +1365 -1214
- package/Plugins.md +117 -105
- package/README.md +4 -13
- package/bin/haraka +197 -298
- package/config/auth_flat_file.ini +1 -0
- package/config/dhparams.pem +8 -0
- package/config/mail_from.is_resolvable.ini +4 -2
- package/config/me +1 -0
- package/config/outbound.ini +0 -2
- package/config/plugins +36 -35
- package/config/smtp.ini +0 -1
- package/config/smtp.json +17 -0
- package/config/tls_cert.pem +23 -0
- package/config/tls_key.pem +28 -0
- package/connection.js +46 -73
- package/contrib/bsd-rc.d/haraka +3 -1
- package/contrib/plugin2npm.sh +6 -36
- package/docs/CoreConfig.md +2 -2
- package/docs/Logging.md +7 -21
- package/docs/Outbound.md +104 -201
- package/docs/Plugins.md +2 -2
- package/docs/Transaction.md +59 -82
- package/docs/plugins/queue/smtp_proxy.md +5 -10
- package/docs/plugins/tls.md +29 -9
- package/endpoint.js +16 -13
- package/haraka.js +10 -14
- package/host_pool.js +5 -5
- package/line_socket.js +3 -4
- package/logger.js +44 -28
- package/outbound/client_pool.js +27 -23
- package/outbound/config.js +4 -6
- package/outbound/fsync_writestream.js +1 -1
- package/outbound/hmail.js +178 -218
- package/outbound/index.js +86 -99
- package/outbound/qfile.js +1 -1
- package/outbound/queue.js +51 -44
- package/outbound/timer_queue.js +3 -2
- package/outbound/tls.js +19 -7
- package/package.json +59 -48
- package/plugins/.eslintrc.yaml +0 -6
- package/plugins/auth/auth_base.js +4 -2
- package/plugins/auth/auth_proxy.js +14 -12
- package/plugins/auth/auth_vpopmaild.js +1 -1
- package/plugins/block_me.js +1 -1
- package/plugins/data.signatures.js +2 -4
- package/plugins/early_talker.js +2 -1
- package/plugins/mail_from.is_resolvable.js +65 -135
- package/plugins/queue/deliver.js +4 -5
- package/plugins/queue/lmtp.js +11 -14
- package/plugins/queue/qmail-queue.js +2 -2
- package/plugins/queue/quarantine.js +2 -2
- package/plugins/queue/rabbitmq.js +16 -17
- package/plugins/queue/smtp_forward.js +3 -3
- package/plugins/queue/smtp_proxy.js +10 -1
- package/plugins/queue/test.js +2 -2
- package/plugins/rcpt_to.host_list_base.js +5 -5
- package/plugins/rcpt_to.in_host_list.js +2 -2
- package/plugins/relay.js +6 -7
- package/plugins/reseed_rng.js +1 -1
- package/plugins/status.js +37 -33
- package/plugins/tls.js +2 -2
- package/plugins/xclient.js +3 -2
- package/plugins.js +50 -54
- package/run_tests +3 -30
- package/server.js +190 -190
- package/smtp_client.js +30 -23
- package/{tests → test}/config/plugins +0 -2
- package/{tests → test}/config/smtp.ini +1 -1
- package/test/config/tls/example.com/_.example.com.key +28 -0
- package/test/config/tls/example.com/example.com.crt +25 -0
- package/test/connection.js +302 -0
- package/test/endpoint.js +94 -0
- package/{tests → test}/fixtures/line_socket.js +1 -1
- package/{tests → test}/fixtures/util_hmailitem.js +19 -25
- package/{tests → test}/host_pool.js +42 -57
- package/test/logger.js +258 -0
- package/test/outbound/hmail.js +141 -0
- package/test/outbound/index.js +220 -0
- package/test/outbound/qfile.js +126 -0
- package/test/outbound_bounce_net_errors.js +142 -0
- package/{tests → test}/outbound_bounce_rfc3464.js +110 -122
- package/test/plugins/auth/auth_base.js +484 -0
- package/test/plugins/auth/auth_vpopmaild.js +83 -0
- package/test/plugins/early_talker.js +104 -0
- package/test/plugins/mail_from.is_resolvable.js +35 -0
- package/test/plugins/queue/smtp_forward.js +206 -0
- package/test/plugins/rcpt_to.host_list_base.js +122 -0
- package/test/plugins/rcpt_to.in_host_list.js +193 -0
- package/test/plugins/relay.js +303 -0
- package/test/plugins/status.js +130 -0
- package/test/plugins/tls.js +70 -0
- package/test/plugins.js +228 -0
- package/test/rfc1869.js +73 -0
- package/test/server.js +491 -0
- package/test/smtp_client.js +299 -0
- package/test/tls_socket.js +273 -0
- package/test/transaction.js +270 -0
- package/tls_socket.js +202 -252
- package/transaction.js +8 -23
- package/CONTRIBUTING.md +0 -1
- package/bin/dkimverify +0 -40
- package/config/access.domains +0 -13
- package/config/attachment.ctype.regex +0 -2
- package/config/attachment.filename.regex +0 -1
- package/config/avg.ini +0 -5
- package/config/bounce.ini +0 -15
- package/config/data.headers.ini +0 -61
- package/config/dkim/dkim_key_gen.sh +0 -78
- package/config/dkim_sign.ini +0 -4
- package/config/dkim_verify.ini +0 -7
- package/config/dnsbl.ini +0 -23
- package/config/greylist.ini +0 -43
- package/config/helo.checks.ini +0 -52
- package/config/messagesniffer.ini +0 -18
- package/config/spamassassin.ini +0 -56
- package/dkim.js +0 -614
- package/docs/plugins/avg.md +0 -35
- package/docs/plugins/bounce.md +0 -69
- package/docs/plugins/clamd.md +0 -147
- package/docs/plugins/esets.md +0 -8
- package/docs/plugins/greylist.md +0 -90
- package/docs/plugins/helo.checks.md +0 -135
- package/docs/plugins/messagesniffer.md +0 -163
- package/docs/plugins/spamassassin.md +0 -180
- package/outbound/mx_lookup.js +0 -70
- package/plugins/auth/auth_ldap.js +0 -3
- package/plugins/avg.js +0 -162
- package/plugins/backscatterer.js +0 -25
- package/plugins/bounce.js +0 -381
- package/plugins/clamd.js +0 -382
- package/plugins/data.uribl.js +0 -4
- package/plugins/dkim_sign.js +0 -395
- package/plugins/dkim_verify.js +0 -62
- package/plugins/dns_list_base.js +0 -221
- package/plugins/dnsbl.js +0 -146
- package/plugins/dnswl.js +0 -58
- package/plugins/esets.js +0 -71
- package/plugins/graph.js +0 -5
- package/plugins/greylist.js +0 -645
- package/plugins/helo.checks.js +0 -533
- package/plugins/messagesniffer.js +0 -381
- package/plugins/rcpt_to.ldap.js +0 -3
- package/plugins/rcpt_to.max_count.js +0 -24
- package/plugins/spamassassin.js +0 -384
- package/tests/config/dkim/example.com/dns +0 -29
- package/tests/config/dkim/example.com/private +0 -6
- package/tests/config/dkim/example.com/public +0 -4
- package/tests/config/dkim/example.com/selector +0 -1
- package/tests/config/dkim.private.key +0 -6
- package/tests/config/dkim_sign.ini +0 -4
- package/tests/config/helo.checks.ini +0 -52
- package/tests/connection.js +0 -327
- package/tests/endpoint.js +0 -128
- package/tests/fixtures/vm_harness.js +0 -59
- package/tests/logger.js +0 -327
- package/tests/outbound/hmail.js +0 -112
- package/tests/outbound/index.js +0 -324
- package/tests/outbound/qfile.js +0 -67
- package/tests/outbound_bounce_net_errors.js +0 -173
- package/tests/plugins/auth/auth_base.js +0 -463
- package/tests/plugins/auth/auth_vpopmaild.js +0 -91
- package/tests/plugins/bounce.js +0 -307
- package/tests/plugins/clamd.js +0 -224
- package/tests/plugins/deprecated/relay_acl.js +0 -140
- package/tests/plugins/deprecated/relay_all.js +0 -59
- package/tests/plugins/dkim_sign.js +0 -315
- package/tests/plugins/dkim_signer.js +0 -108
- package/tests/plugins/dns_list_base.js +0 -259
- package/tests/plugins/dnsbl.js +0 -101
- package/tests/plugins/early_talker.js +0 -115
- package/tests/plugins/greylist.js +0 -58
- package/tests/plugins/helo.checks.js +0 -525
- package/tests/plugins/mail_from.is_resolvable.js +0 -116
- package/tests/plugins/queue/smtp_forward.js +0 -221
- package/tests/plugins/rcpt_to.host_list_base.js +0 -132
- package/tests/plugins/rcpt_to.in_host_list.js +0 -218
- package/tests/plugins/relay.js +0 -339
- package/tests/plugins/spamassassin.js +0 -171
- package/tests/plugins/status.js +0 -138
- package/tests/plugins/tls.js +0 -84
- package/tests/plugins.js +0 -247
- package/tests/rfc1869.js +0 -61
- package/tests/server.js +0 -510
- package/tests/smtp_client/auth.js +0 -105
- package/tests/smtp_client/basic.js +0 -101
- package/tests/smtp_client.js +0 -80
- package/tests/tls_socket.js +0 -333
- package/tests/transaction.js +0 -284
- /package/docs/{plugins → deprecated}/dkim_sign.md +0 -0
- /package/docs/{plugins → deprecated}/dkim_verify.md +0 -0
- /package/docs/{plugins → deprecated}/dnsbl.md +0 -0
- /package/docs/{plugins → deprecated}/dnswl.md +0 -0
- /package/{tests → test}/.eslintrc.yaml +0 -0
- /package/{tests → test}/config/auth_flat_file.ini +0 -0
- /package/{tests → test}/config/dhparams.pem +0 -0
- /package/{tests → test}/config/host_list +0 -0
- /package/{tests → test}/config/outbound_tls_cert.pem +0 -0
- /package/{tests → test}/config/outbound_tls_key.pem +0 -0
- /package/{tests → test}/config/smtp_forward.ini +0 -0
- /package/{tests → test}/config/tls/ec.pem +0 -0
- /package/{tests → test}/config/tls/haraka.local.pem +0 -0
- /package/{tests → test}/config/tls/mismatched.pem +0 -0
- /package/{tests → test}/config/tls.ini +0 -0
- /package/{tests → test}/config/tls_cert.pem +0 -0
- /package/{tests → test}/config/tls_key.pem +0 -0
- /package/{tests → test}/fixtures/todo_qfile.txt +0 -0
- /package/{tests → test}/installation/config/test-plugin-flat +0 -0
- /package/{tests → test}/installation/config/test-plugin.ini +0 -0
- /package/{tests → test}/installation/config/tls.ini +0 -0
- /package/{tests → test}/installation/node_modules/load_first/index.js +0 -0
- /package/{tests → test}/installation/node_modules/load_first/package.json +0 -0
- /package/{tests → test}/installation/node_modules/test-plugin/config/test-plugin-flat +0 -0
- /package/{tests → test}/installation/node_modules/test-plugin/config/test-plugin.ini +0 -0
- /package/{tests → test}/installation/node_modules/test-plugin/package.json +0 -0
- /package/{tests → test}/installation/node_modules/test-plugin/test-plugin.js +0 -0
- /package/{tests → test}/installation/plugins/base_plugin.js +0 -0
- /package/{tests → test}/installation/plugins/folder_plugin/index.js +0 -0
- /package/{tests → test}/installation/plugins/folder_plugin/package.json +0 -0
- /package/{tests → test}/installation/plugins/inherits.js +0 -0
- /package/{tests → test}/installation/plugins/load_first.js +0 -0
- /package/{tests → test}/installation/plugins/plugin.js +0 -0
- /package/{tests → test}/installation/plugins/tls.js +0 -0
- /package/{tests → test}/loud/config/dhparams.pem +0 -0
- /package/{tests → test}/loud/config/tls/goobered.pem +0 -0
- /package/{tests → test}/loud/config/tls.ini +0 -0
- /package/{tests → test}/mail_specimen/base64-root-part.txt +0 -0
- /package/{tests → test}/mail_specimen/varied-fold-lengths-preserve-data.txt +0 -0
- /package/{tests → test}/queue/1507509981169_1507509981169_0_61403_e0Y0Ym_1_fixed +0 -0
- /package/{tests → test}/queue/1507509981169_1507509981169_0_61403_e0Y0Ym_1_haraka +0 -0
- /package/{tests → test}/queue/1508269674999_1508269674999_0_34002_socVUF_1_haraka +0 -0
- /package/{tests → test}/queue/1508455115683_1508455115683_0_90253_9Q4o4V_1_haraka +0 -0
- /package/{tests → test}/queue/multibyte +0 -0
- /package/{tests → test}/queue/plain +0 -0
- /package/{tests → test}/queue/zero-length +0 -0
- /package/{tests → test}/test-queue/delete-me +0 -0
package/docs/plugins/bounce.md
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
# bounce
|
|
2
|
-
|
|
3
|
-
Provide options for bounce processing.
|
|
4
|
-
|
|
5
|
-
## Configuration
|
|
6
|
-
|
|
7
|
-
Each feature can be enabled/disabled with a true/false toggle in the [check]
|
|
8
|
-
section of `config/bounce.ini`:
|
|
9
|
-
|
|
10
|
-
Some features can have rejections disabled in the [reject] section.
|
|
11
|
-
|
|
12
|
-
[check]
|
|
13
|
-
reject_all=false
|
|
14
|
-
single_recipient=true
|
|
15
|
-
empty_return_path=true
|
|
16
|
-
bad_rcpt=true
|
|
17
|
-
bounce_spf=true
|
|
18
|
-
non_local_msgid=true
|
|
19
|
-
|
|
20
|
-
[reject]
|
|
21
|
-
single_recipient=true
|
|
22
|
-
empty_return_path=true
|
|
23
|
-
bounce_spf=false
|
|
24
|
-
non_local_msgid=false
|
|
25
|
-
|
|
26
|
-
## Features
|
|
27
|
-
|
|
28
|
-
### reject\_all
|
|
29
|
-
|
|
30
|
-
When enabled, blocks all bounce messages using the simple rule of checking
|
|
31
|
-
for `MAIL FROM:<>`.
|
|
32
|
-
|
|
33
|
-
It is generally a bad idea to block all bounces. This option can be useful
|
|
34
|
-
for mail servers at domains with frequent spoofing and few or no human users.
|
|
35
|
-
|
|
36
|
-
### single\_recipient
|
|
37
|
-
|
|
38
|
-
Valid bounces have a single recipient. Assure that the message really is a
|
|
39
|
-
bounce by enforcing bounces to be addressed to a single recipient.
|
|
40
|
-
|
|
41
|
-
This check is skipped for relays or hosts with a private IP, this is because
|
|
42
|
-
Microsoft Exchange distribution lists will send messages to list members with
|
|
43
|
-
a null return-path when the 'Do not send delivery reports' option is enabled
|
|
44
|
-
(yes, really...).
|
|
45
|
-
|
|
46
|
-
### empty\_return\_path
|
|
47
|
-
|
|
48
|
-
Valid bounces should have an empty return path. Test for the presence of the
|
|
49
|
-
Return-Path header in bounces and disallow.
|
|
50
|
-
|
|
51
|
-
### bad\_rcpt
|
|
52
|
-
|
|
53
|
-
Disallow bounces to email addresses listed in `config/bounce_bad_rcpt`.
|
|
54
|
-
|
|
55
|
-
Include email addresses in that file that should *never* receive bounce
|
|
56
|
-
messages. Examples of email addresses that should be listed are:
|
|
57
|
-
autoresponders, do-not-reply@example.com, dmarc-feedback@example.com, and
|
|
58
|
-
any other email addresses used solely for machine generated messages.
|
|
59
|
-
|
|
60
|
-
### bounce\_spf
|
|
61
|
-
|
|
62
|
-
Parses the message body and any MIME parts for Received: headers and
|
|
63
|
-
strips out the IP addresses of each Received hop and then checks what
|
|
64
|
-
the SPF result would have been if bounced message had been sent by that
|
|
65
|
-
hop.
|
|
66
|
-
|
|
67
|
-
If no 'Pass' result is found, then this test will fail.
|
|
68
|
-
If SPF returns 'None', 'TempError' or 'PermError' then the test will
|
|
69
|
-
be skipped.
|
package/docs/plugins/clamd.md
DELETED
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
clamd
|
|
2
|
-
=====
|
|
3
|
-
|
|
4
|
-
This plug-in implements Anti-Virus scanning with ClamAV using the **clamd**
|
|
5
|
-
daemon.
|
|
6
|
-
|
|
7
|
-
The plug-in will reject any message that ClamAV considers to be a virus.
|
|
8
|
-
If an error occurs (e.g. clamd not running or a timeout), the
|
|
9
|
-
message will be deferred with a temporary failure.
|
|
10
|
-
|
|
11
|
-
## Configuration
|
|
12
|
-
|
|
13
|
-
The following options can be defined in clamd.ini;
|
|
14
|
-
|
|
15
|
-
### clamd\_socket (default: localhost:3310)
|
|
16
|
-
|
|
17
|
-
N.N.N.N:port, [ipv6::literal]:port, host:port or /path/to/socket of
|
|
18
|
-
the clamd daemon.
|
|
19
|
-
|
|
20
|
-
Multiple hosts can be listed separated by comma, semi-colon or spaces.
|
|
21
|
-
|
|
22
|
-
If :port is omitted it defaults to 3310.
|
|
23
|
-
|
|
24
|
-
On connection error or timeout the next host in the list will be tried.
|
|
25
|
-
When the host list is exhausted, the message will be deferred with
|
|
26
|
-
a temporary failure.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
### randomize\_host\_order (default: false)
|
|
30
|
-
|
|
31
|
-
If this is set then the list of hosts with be randomized before a
|
|
32
|
-
connection is attempted.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
### only\_with\_attachments (default: false)
|
|
36
|
-
|
|
37
|
-
Set this option to only scan messages that contain non-textual
|
|
38
|
-
attachments. This is a performance optimization, however it will
|
|
39
|
-
prevent ClamAV from detecting threats such as Phishing in plain-text
|
|
40
|
-
or HTML messages.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
### connect\_timeout (default: 10)
|
|
44
|
-
|
|
45
|
-
Timeout connection to host after this many seconds. A timeout will
|
|
46
|
-
cause the next host in the list to be tried. Once all hosts have
|
|
47
|
-
been tried then a temporary failure will be returned.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
### timeout (default: 30)
|
|
51
|
-
|
|
52
|
-
Post-connection timeout if there is no activity on the socket after
|
|
53
|
-
this many seconds. A timeout will cause the message to be rejected
|
|
54
|
-
with a tempoary failure.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
### max\_size (default: 26214400)
|
|
58
|
-
|
|
59
|
-
The maximum size of message that should be sent to clamd in bytes.
|
|
60
|
-
This option should not be larger than the StreamMaxLength value in
|
|
61
|
-
clamd.conf as clamd will stop scanning once this limit is reached.
|
|
62
|
-
If the clamd limit is reached the plug-in will log a notice that
|
|
63
|
-
this has happened and will allow the message though.
|
|
64
|
-
|
|
65
|
-
### [reject]
|
|
66
|
-
|
|
67
|
-
An optional reject section can offer control over when to reject connections.
|
|
68
|
-
The default settings are shown. ClamAV recommends that hits coming from
|
|
69
|
-
SafeBrowsing / Phishing / Heuristics, Potentially Unwanted Applications, and
|
|
70
|
-
UNOFFICIAL be used only for scoring.
|
|
71
|
-
|
|
72
|
-
* virus=true
|
|
73
|
-
* error=true
|
|
74
|
-
|
|
75
|
-
The following reject options are disabled by default in clamd.conf. With a
|
|
76
|
-
default ClamAV install, these will have no effect. When an admin enables in
|
|
77
|
-
clamd.conf, Haraka with then, by default, reject such messages. Adjust these
|
|
78
|
-
settings to suit.
|
|
79
|
-
|
|
80
|
-
* Broken.Executable=true
|
|
81
|
-
* Structured=true
|
|
82
|
-
* Encrypted=true
|
|
83
|
-
* PUA=true
|
|
84
|
-
* OLE2=true
|
|
85
|
-
* Safebrowsing=true
|
|
86
|
-
* UNOFFICIAL=true
|
|
87
|
-
|
|
88
|
-
The following options are enabled by default in clamd but ClamAV suggests
|
|
89
|
-
using them only for scoring.
|
|
90
|
-
|
|
91
|
-
* Phishing=false
|
|
92
|
-
|
|
93
|
-
## [check]
|
|
94
|
-
|
|
95
|
-
The optional check section can allow skipping ClamAV check for remote connection
|
|
96
|
-
meeting following criteria.
|
|
97
|
-
|
|
98
|
-
- authenticated
|
|
99
|
-
|
|
100
|
-
Default: true
|
|
101
|
-
|
|
102
|
-
If true, messages from authenticated users will be scanned.
|
|
103
|
-
|
|
104
|
-
- private\_ip
|
|
105
|
-
|
|
106
|
-
Default: true
|
|
107
|
-
|
|
108
|
-
If true, messages from private IPs will be scanned.
|
|
109
|
-
|
|
110
|
-
- local\_ip
|
|
111
|
-
|
|
112
|
-
Default: true
|
|
113
|
-
|
|
114
|
-
If true, messages from localhost will be scanned.
|
|
115
|
-
|
|
116
|
-
- relay
|
|
117
|
-
|
|
118
|
-
Default: true
|
|
119
|
-
|
|
120
|
-
If true, messages that are to be relayed will be scanned.
|
|
121
|
-
|
|
122
|
-
## clamd.excludes
|
|
123
|
-
|
|
124
|
-
This file can contain a list of virus name patterns that when matched, are
|
|
125
|
-
not rejected by this plugin. An X-Haraka-Virus: header will be inserted
|
|
126
|
-
containing the virus name. This header can then be used for scoring
|
|
127
|
-
in other plugins.
|
|
128
|
-
|
|
129
|
-
The format of the file is one pattern per line. Comments are prefixed
|
|
130
|
-
with #. Matches are case-insensitive.
|
|
131
|
-
|
|
132
|
-
Patterns are expressed using wildcards (e.g. * and ?) or
|
|
133
|
-
via regexp by enclosing the pattern in //.
|
|
134
|
-
|
|
135
|
-
To negate a match (e.g. reject if it matches), prefix the match with !.
|
|
136
|
-
Negative matches are always tested first.
|
|
137
|
-
|
|
138
|
-
Example:
|
|
139
|
-
|
|
140
|
-
`````
|
|
141
|
-
# Always reject test signatures
|
|
142
|
-
!*.TestSig_*
|
|
143
|
-
# Skip all unofficial signatures
|
|
144
|
-
*.UNOFFICIAL
|
|
145
|
-
# Phishing
|
|
146
|
-
Heuristics.Phishing.*
|
|
147
|
-
`````
|
package/docs/plugins/esets.md
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
esets
|
|
2
|
-
-----
|
|
3
|
-
|
|
4
|
-
This plugin allows virus scanning with ESET Mail Security for Linux/BSD.
|
|
5
|
-
|
|
6
|
-
Install the software as per the intructions from ESET and enable this plugin
|
|
7
|
-
and it will scan each message using the "esets_cli" command which defaults to
|
|
8
|
-
/opt/eset/esets/bin/esets_cli.
|
package/docs/plugins/greylist.md
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
# Greylist
|
|
2
|
-
|
|
3
|
-
Basic greylisting plugin that follows common practices found on internets.
|
|
4
|
-
|
|
5
|
-
## Principles of work
|
|
6
|
-
|
|
7
|
-
### Notation
|
|
8
|
-
|
|
9
|
-
The so-called _tuple_ consists of the following:
|
|
10
|
-
|
|
11
|
-
* First subdomain of rDNS is stripped off (but no shorter than the domain boundary). This is considered a _hostid_.
|
|
12
|
-
* Envelope sender is the _sender_.
|
|
13
|
-
* RCPT TO would supply the _recipient_.
|
|
14
|
-
|
|
15
|
-
_hostid_ in above notation is chosen unless:
|
|
16
|
-
|
|
17
|
-
1. The connecting host has no PTR record, a.k.a. reverse DNS (rDNS). [gl]
|
|
18
|
-
1. The rDNS record contains the first two or last two octets of the IP address. [fcrdns]
|
|
19
|
-
1. The rDNS record contains the ‘short’, decimal, or hex representation of the full IP address. [fcrdns] [gl]
|
|
20
|
-
1. Multiple rDNS records are returned. [gl]
|
|
21
|
-
1. The rDNS record cannot be verified by forward confirmation (e.g. FCrDNS). [fcrdns]
|
|
22
|
-
1. The top-level-domain (TLD) used is not valid. [gl]
|
|
23
|
-
|
|
24
|
-
In other cases, it's set to be the remote party's IP address.
|
|
25
|
-
|
|
26
|
-
We define the following time periods:
|
|
27
|
-
|
|
28
|
-
* _black_: between first connect and start of _gray_. Defer.
|
|
29
|
-
* _gray_: between _black_ and start of _white_. Allow. Host must re-try within this window.
|
|
30
|
-
* _white_: comes after _gray_. Allow up until the end of period, then let the record expire in case no connections were made.
|
|
31
|
-
|
|
32
|
-
### Algorithm
|
|
33
|
-
|
|
34
|
-
The greylist algo is as following:
|
|
35
|
-
|
|
36
|
-
* Party connects. All FcrDNS & DNSWL checks are run by earlier plugins.
|
|
37
|
-
* Party sends _recipient_
|
|
38
|
-
* If not already whitelisted
|
|
39
|
-
* Check _tuple_ color (compare current TS against record creation TS)
|
|
40
|
-
* _black_?
|
|
41
|
-
* Create if no record exists. Defer.
|
|
42
|
-
* _gray_?
|
|
43
|
-
* Allow. Promote record to _white_ status.
|
|
44
|
-
* _white_?
|
|
45
|
-
* Allow. Update record TS.
|
|
46
|
-
* In special case, _data_ hook runs above algo for all recipients. If any matched, all inherit the action.
|
|
47
|
-
|
|
48
|
-
### DB schema
|
|
49
|
-
|
|
50
|
-
We store in Redis.
|
|
51
|
-
|
|
52
|
-
Key format for greylisting entries:
|
|
53
|
-
|
|
54
|
-
* grey:${hostid}:${sender}:${recipient} - grey record
|
|
55
|
-
* white:${hostid} - white record
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
For _white_:
|
|
59
|
-
|
|
60
|
-
{ first_connect: TS, whitelisted: TS, updated: TS, lifetime: TTL, tried: Integer, tried_when_greylisted: Integer }
|
|
61
|
-
|
|
62
|
-
Where
|
|
63
|
-
_first_connect_: TS of first connection (sender)
|
|
64
|
-
_whitelisted_: basically the TS of this entry creation
|
|
65
|
-
_updated_: last update TS
|
|
66
|
-
_lifetime_: seconds for this entry to exist (== TTL)
|
|
67
|
-
_tried_: number of checks against this entry
|
|
68
|
-
_tried_when_greylisted_: number of checks while the host was +grey+ (sender).
|
|
69
|
-
|
|
70
|
-
For _grey_:
|
|
71
|
-
|
|
72
|
-
{ created: TS, updated: TS, lifetime: TTL, tried: Integer }
|
|
73
|
-
|
|
74
|
-
Where
|
|
75
|
-
_created_: TS of first connection (copied to _first_connect_ of _white_ after promotion)
|
|
76
|
-
_updated_: last update TS
|
|
77
|
-
_lifetime_: seconds for this entry to exist (== TTL)
|
|
78
|
-
_tried_: number of checks against this entry (copied to _tried_when_greylisted_ of _white_ after promotion)
|
|
79
|
-
|
|
80
|
-
### Whitelisting
|
|
81
|
-
|
|
82
|
-
It's possible to whitelist hosts using the following section in greylist.ini config file:
|
|
83
|
-
|
|
84
|
-
* ip\_whitelist IP or subnet (prefix notation)
|
|
85
|
-
* envelope\_whitelist MAIL FROM (email or domain)
|
|
86
|
-
* recipient\_whitelist RCPT TO (email or domain)
|
|
87
|
-
|
|
88
|
-
List of known dynamic hosts, to use the IP instead of the domain:
|
|
89
|
-
|
|
90
|
-
* special\_dynamic\_domains Domain
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
# helo.checks
|
|
2
|
-
|
|
3
|
-
This plugin performs a number of checks on the HELO string.
|
|
4
|
-
|
|
5
|
-
HELO strings are very often forged or dubious in spam and so this can be a
|
|
6
|
-
highly effective and false-positive free anti-spam measure.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
## Usage
|
|
10
|
-
|
|
11
|
-
helo.checks results can be accessed by subsequent plugins:
|
|
12
|
-
|
|
13
|
-
var h = connection.results.get('helo.checks');
|
|
14
|
-
if (h.pass && h.pass.length > 5) {
|
|
15
|
-
// nice job, you passed 6+ tests
|
|
16
|
-
}
|
|
17
|
-
if (h.fail && h.fail.length > 3) {
|
|
18
|
-
// yikes, you failed 4+ tests!
|
|
19
|
-
}
|
|
20
|
-
if (connection.results.has('helo.checks','pass', /^forward_dns/) {
|
|
21
|
-
// the HELO hostname is valid
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
## Configuration
|
|
26
|
-
|
|
27
|
-
* helo.checks.regexps
|
|
28
|
-
|
|
29
|
-
List of regular expressions to match against the HELO string. The regular
|
|
30
|
-
expressions are automatically wrapped in `^` and `$` so they always match
|
|
31
|
-
the entire string.
|
|
32
|
-
|
|
33
|
-
* helo.checks.ini
|
|
34
|
-
|
|
35
|
-
INI file which controls enabling of certain checks:
|
|
36
|
-
|
|
37
|
-
* dns\_timeout=30
|
|
38
|
-
|
|
39
|
-
How many seconds to wait for DNS queries to timeout.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
### [check]
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
* valid\_hostname=true
|
|
46
|
-
|
|
47
|
-
Checks that the HELO has at least one '.' in it and the organizational
|
|
48
|
-
name is possible (ie, a host within a Public Suffix).
|
|
49
|
-
|
|
50
|
-
* bare\_ip=true
|
|
51
|
-
|
|
52
|
-
Checks for HELO <IP> where the IP is not surrounded by square brackets.
|
|
53
|
-
This is an RFC violation so should always be enabled.
|
|
54
|
-
|
|
55
|
-
* dynamic=true
|
|
56
|
-
|
|
57
|
-
Checks to see if all or part the connecting IP address appears within
|
|
58
|
-
the HELO argument to indicate that the client has a dynamic IP address.
|
|
59
|
-
|
|
60
|
-
* literal\_mismatch=1|2|3
|
|
61
|
-
|
|
62
|
-
Checks to see if the IP literal used matches the connecting IP address.
|
|
63
|
-
If set to 1, the full IP must match. If set to 2, the /24 must match.
|
|
64
|
-
If set to 3, the /24 may match, or the IP can be private (RFC 1918).
|
|
65
|
-
|
|
66
|
-
* match\_re=true
|
|
67
|
-
|
|
68
|
-
See above. This is merely an on/off toggle.
|
|
69
|
-
|
|
70
|
-
* big\_company=true
|
|
71
|
-
|
|
72
|
-
See below. This is merely an on/off toggle.
|
|
73
|
-
|
|
74
|
-
* forward\_dns=true
|
|
75
|
-
|
|
76
|
-
Perform a DNS lookup of the HELO hostname and validate that the IP of
|
|
77
|
-
the remote is included in the IP(s) of the HELO hostname.
|
|
78
|
-
|
|
79
|
-
This test requires that the valid\_hostname check is also enabled.
|
|
80
|
-
|
|
81
|
-
* rdns\_match=true
|
|
82
|
-
|
|
83
|
-
Sees if the HELO hostname (or at least the domain) match the rDNS
|
|
84
|
-
hostname(s).
|
|
85
|
-
|
|
86
|
-
* host\_mismatch=true
|
|
87
|
-
|
|
88
|
-
If HELO is called multiple times, checks if the hostname differs between
|
|
89
|
-
EHLO invocations.
|
|
90
|
-
|
|
91
|
-
* proto\_mismatch=true
|
|
92
|
-
|
|
93
|
-
If EHLO was sent and the host later tries to then send HELO or vice-versa.
|
|
94
|
-
|
|
95
|
-
### [reject]
|
|
96
|
-
|
|
97
|
-
For all of the checks included above, a matching key in the reject section
|
|
98
|
-
controls whether messages that fail the test are rejected.
|
|
99
|
-
|
|
100
|
-
Defaults shown:
|
|
101
|
-
|
|
102
|
-
[reject]
|
|
103
|
-
host_mismatch=false
|
|
104
|
-
literal_mismatch=false
|
|
105
|
-
proto_mismatch=false
|
|
106
|
-
rdns_match=false
|
|
107
|
-
dynamic=false
|
|
108
|
-
bare_ip=false
|
|
109
|
-
valid_hostname=false
|
|
110
|
-
forward_dns=false
|
|
111
|
-
big_company=false
|
|
112
|
-
|
|
113
|
-
### [skip]
|
|
114
|
-
|
|
115
|
-
* private\_ip=true
|
|
116
|
-
|
|
117
|
-
Bypasses checks for clients within RFC1918, Loopback or APIPA IP address ranges.
|
|
118
|
-
|
|
119
|
-
* relaying
|
|
120
|
-
|
|
121
|
-
Bypass checks for clients who have relaying privileges (whitelisted IP,
|
|
122
|
-
SMTP-AUTH, etc).
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
### [bigco]
|
|
126
|
-
|
|
127
|
-
A list of <helo>=<rdns>[,<rdns>...] to match against. If the HELO matches
|
|
128
|
-
what's on the left hand side, the reverse-DNS must match one of the
|
|
129
|
-
entries on the right hand side or the mail is blocked.
|
|
130
|
-
|
|
131
|
-
Example:
|
|
132
|
-
|
|
133
|
-
yahoo.com=yahoo.com,yahoo.co.jp
|
|
134
|
-
aol.com=aol.com
|
|
135
|
-
gmail.com=google.com
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
messagesniffer
|
|
2
|
-
==============
|
|
3
|
-
|
|
4
|
-
This plugin provides integration with the commerical Anti-Spam product [MessageSniffer](http://armresearch.com/products/sniffer.jsp) by Arm Research Labs using its XML Client interface [XCI](http://armresearch.com/support/articles/software/snfServer/xci/) over TCP.
|
|
5
|
-
|
|
6
|
-
Installation
|
|
7
|
-
------------
|
|
8
|
-
|
|
9
|
-
Install the SNF Client/Server package for your platform as per the instructions on the MessageSniffer website.
|
|
10
|
-
|
|
11
|
-
Modify your SNFServer.xml file and under the 'xheaders' section set:
|
|
12
|
-
|
|
13
|
-
* output mode='api'
|
|
14
|
-
|
|
15
|
-
This prevents MessageSniffer from adding additional headers to the temporary file used to send it the message data which is
|
|
16
|
-
unnecessary as Haraka reads the headers from the XCI response.
|
|
17
|
-
|
|
18
|
-
* rulebase on-off='on'
|
|
19
|
-
* result on-off='on'
|
|
20
|
-
* black on-off='on'
|
|
21
|
-
* while on-off='on'
|
|
22
|
-
* clean on-off='on'
|
|
23
|
-
* all symbol on-off='on'
|
|
24
|
-
|
|
25
|
-
These cause SNFServer to send Haraka additional headers that are inserted into all messages scanned by MessageSniffer and
|
|
26
|
-
will aid debugging and troubleshooting.
|
|
27
|
-
|
|
28
|
-
Once this is done start/restart the SNF server.
|
|
29
|
-
|
|
30
|
-
Configuration
|
|
31
|
-
-------------
|
|
32
|
-
|
|
33
|
-
This plugin uses `messagesniffer.ini` for configuration. The `[main]` section is for global configuration, the `[gbudb]`
|
|
34
|
-
section is used to specify the action that should be taken based on the GBUdb result which is checked at the start of the
|
|
35
|
-
connection and the `[message]` section is used to specify the action to be taken based on the main scan result.
|
|
36
|
-
|
|
37
|
-
`[main]`
|
|
38
|
-
|
|
39
|
-
- port
|
|
40
|
-
|
|
41
|
-
Default: 9001
|
|
42
|
-
TCP port to use when communicating to the SNFServer daemon.
|
|
43
|
-
This needs to match the `<xci on-off='on' port='9001'/>` value in the SNFServer.xml file.
|
|
44
|
-
|
|
45
|
-
- tmpdir
|
|
46
|
-
|
|
47
|
-
Default: /tmp
|
|
48
|
-
Temporary directory used to write temporary message files to that are read by the SNFServer daemon.
|
|
49
|
-
This directory and the files within need to be readable by the user that SNFServer is running as.
|
|
50
|
-
|
|
51
|
-
- gbudb\_report\_deny = [ true | false | 0 | 1 ]
|
|
52
|
-
|
|
53
|
-
Default: false
|
|
54
|
-
This is an experimental option that will record a GBUdb 'bad' encounter for a connected IP address when a client
|
|
55
|
-
disconnects with no message having been sent or seen by MessageSniffer but Haraka has recorded a hard rejection at
|
|
56
|
-
some point during the session. The idea behind this option is that it allows other Haraka plugins rejections influence
|
|
57
|
-
GBUdb IP reputation where MessageSniffer isn't seeing the actual message because it is being rejected pre-DATA.
|
|
58
|
-
|
|
59
|
-
- tag\_string
|
|
60
|
-
|
|
61
|
-
Default: [SPAM]
|
|
62
|
-
String to prepend to the Subject line if the 'tag' action is applied.
|
|
63
|
-
|
|
64
|
-
`[gbudb]`
|
|
65
|
-
|
|
66
|
-
- white = [ accept | allow | continue | retry | tempfail | reject | quarantine | tag ]
|
|
67
|
-
|
|
68
|
-
Default: accept
|
|
69
|
-
Action to take when GBUdb reports a 'white' result.
|
|
70
|
-
|
|
71
|
-
- caution = [ accept | allow | continue | retry | tempfail | reject | quarantine | tag ]
|
|
72
|
-
|
|
73
|
-
Default: continue
|
|
74
|
-
Action to take when GBUdb reports a 'caution' result.
|
|
75
|
-
|
|
76
|
-
- black = [ accept | allow | continue | retry | tempfail | reject | quarantine | tag ]
|
|
77
|
-
|
|
78
|
-
Default: continue
|
|
79
|
-
Action to take when GBUdb reports a 'black' result.
|
|
80
|
-
|
|
81
|
-
- truncate = [ accept | allow | continue | retry | tempfail | reject | quarantine | tag ]
|
|
82
|
-
|
|
83
|
-
Default: reject
|
|
84
|
-
Action to take when GBUdb reports a 'truncate' result.
|
|
85
|
-
|
|
86
|
-
`[message]`
|
|
87
|
-
|
|
88
|
-
- white = [ accept | allow | continue | retry | tempfail | reject | quarantine | tag ]
|
|
89
|
-
|
|
90
|
-
Default: continue
|
|
91
|
-
Action to take when MessageSniffer reports a 'white' result (result code: 0).
|
|
92
|
-
|
|
93
|
-
- local\_white = [ accept | allow | continue | retry | tempfail | reject | quarantine | tag ]
|
|
94
|
-
|
|
95
|
-
Default: accept
|
|
96
|
-
Action to take when MessageSniffer reports a local whitelist result (result code: 1).
|
|
97
|
-
NOTE: You will not see this result unless you Arm support have customized your rulebase and added white rules for you.
|
|
98
|
-
|
|
99
|
-
- truncate = [ accept | allow | continue | retry | tempfail | reject | quarantine | tag ]
|
|
100
|
-
|
|
101
|
-
Default: reject
|
|
102
|
-
Action to take when MessageSniffer reports a GBUdb result of 'truncate' (result code: 20).
|
|
103
|
-
NOTE: GBUdb IP lookups during the data phase can be different than the connecting IP address if you have configured
|
|
104
|
-
Source and DrillDown options in the Training section of SNFServer.xml.
|
|
105
|
-
|
|
106
|
-
- caution = [ accept | allow | continue | retry | tempfail | reject | quarantine | tag ]
|
|
107
|
-
|
|
108
|
-
Default: continue
|
|
109
|
-
Action to take when MessageSniffer reports a GBUdb result of 'caution' (result code: 40).
|
|
110
|
-
NOTE: GBUdb IP lookups during the data phase can be different than the connecting IP address if you have configured
|
|
111
|
-
Source and DrillDown options in the Training section of SNFServer.xml.
|
|
112
|
-
|
|
113
|
-
- black = [ accept | allow | continue | retry | tempfail | reject | quarantine | tag ]
|
|
114
|
-
|
|
115
|
-
Default: continue
|
|
116
|
-
Action to take when MessageSniffer reports a GBUdb result of 'black' (result code: 63).
|
|
117
|
-
NOTE: GBUdb IP lookups during the data phase can be different than the connecting IP address if you have configured
|
|
118
|
-
Source and DrillDown options in the Training section of SNFServer.xml.
|
|
119
|
-
|
|
120
|
-
- code\_NN = [ accept | allow | continue | retry | tempfail | reject | quarantine | tag ]
|
|
121
|
-
|
|
122
|
-
NOTE: replace NN with the numeric MessageSniffer [result code](http://armresearch.com/support/articles/software/snfServer/core.jsp)
|
|
123
|
-
Action to take when MessageSniffer reports a result code other than those explicitly defined above.
|
|
124
|
-
|
|
125
|
-
- nonzero = [ accept | allow | continue | retry | tempfail | reject | quarantine | tag ]
|
|
126
|
-
|
|
127
|
-
Defalt: reject
|
|
128
|
-
Action to take for any non-zero result code other than those explicity defined above. This is a catch-all result that
|
|
129
|
-
is checked last after all other settings have been checked so you can define a code\_NN value to prevent this action from
|
|
130
|
-
being taken.
|
|
131
|
-
|
|
132
|
-
Actions
|
|
133
|
-
-------
|
|
134
|
-
|
|
135
|
-
* accept
|
|
136
|
-
|
|
137
|
-
Accept the message and skip further plugins (whitelist).
|
|
138
|
-
|
|
139
|
-
* allow | continute
|
|
140
|
-
|
|
141
|
-
Continue to the next plugin.
|
|
142
|
-
|
|
143
|
-
* retry | tempfail
|
|
144
|
-
|
|
145
|
-
Reject the message with a temporary failure message (DENYSOFT).
|
|
146
|
-
|
|
147
|
-
* reject
|
|
148
|
-
|
|
149
|
-
Reject the message with a permanent failure message (DENY).
|
|
150
|
-
|
|
151
|
-
* quarantine
|
|
152
|
-
|
|
153
|
-
Continue to the next plugin. If the message isn't rejected by another plugin - it will cause the message to be quarantined
|
|
154
|
-
and the message will not be delivered to the recipient(s).
|
|
155
|
-
|
|
156
|
-
NOTE: this option requires the queue/quarantine plugin in your config/plugins files and it must be listed before any
|
|
157
|
-
other queue plugins.
|
|
158
|
-
|
|
159
|
-
* tag
|
|
160
|
-
|
|
161
|
-
Tag the subject with the default 'tag\_string' defined in the `main` section above, this will also set X-Spam-Flag: YES in
|
|
162
|
-
the message headers. Once tagged, processing will continue to the next plugin.
|
|
163
|
-
|