Haraka 2.8.28 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/.eslintrc.yaml +2 -10
  2. package/Changes.md +68 -2
  3. package/Dockerfile +1 -1
  4. package/Plugins.md +7 -4
  5. package/README.md +2 -6
  6. package/config/outbound.ini +0 -7
  7. package/config/plugins +1 -1
  8. package/config/smtp.ini +1 -1
  9. package/config/smtp_forward.ini +2 -8
  10. package/config/smtp_proxy.ini +0 -6
  11. package/connection.js +178 -204
  12. package/coverage/lcov.info +13863 -0
  13. package/coverage/tmp/coverage-42958-1658373250585-0.json +1 -0
  14. package/coverage/tmp/coverage-42961-1658373250529-0.json +1 -0
  15. package/dkim.js +65 -73
  16. package/docs/Body.md +1 -22
  17. package/docs/CoreConfig.md +2 -2
  18. package/docs/Header.md +1 -47
  19. package/docs/Outbound.md +8 -36
  20. package/endpoint.js +1 -1
  21. package/haraka.js +1 -1
  22. package/host_pool.js +8 -12
  23. package/logger.js +25 -32
  24. package/outbound/client_pool.js +11 -153
  25. package/outbound/config.js +5 -11
  26. package/outbound/hmail.js +109 -143
  27. package/outbound/index.js +13 -25
  28. package/outbound/mx_lookup.js +10 -7
  29. package/outbound/queue.js +8 -12
  30. package/outbound/timer_queue.js +2 -4
  31. package/outbound/tls.js +17 -18
  32. package/outbound/todo.js +1 -0
  33. package/package.json +42 -40
  34. package/plugins/auth/auth_base.js +39 -63
  35. package/plugins/auth/auth_bridge.js +3 -4
  36. package/plugins/auth/auth_proxy.js +16 -16
  37. package/plugins/auth/auth_vpopmaild.js +30 -37
  38. package/plugins/auth/flat_file.js +9 -13
  39. package/plugins/avg.js +9 -11
  40. package/plugins/backscatterer.js +1 -1
  41. package/plugins/block_me.js +2 -6
  42. package/plugins/bounce.js +106 -124
  43. package/plugins/clamd.js +59 -63
  44. package/plugins/data.signatures.js +6 -6
  45. package/plugins/data.uribl.js +1 -415
  46. package/plugins/delay_deny.js +19 -20
  47. package/plugins/dkim_sign.js +56 -62
  48. package/plugins/dkim_verify.js +9 -8
  49. package/plugins/dns_list_base.js +43 -42
  50. package/plugins/dnsbl.js +41 -46
  51. package/plugins/dnswl.js +23 -26
  52. package/plugins/early_talker.js +24 -28
  53. package/plugins/esets.js +8 -11
  54. package/plugins/greylist.js +161 -190
  55. package/plugins/helo.checks.js +175 -197
  56. package/plugins/mail_from.is_resolvable.js +38 -38
  57. package/plugins/messagesniffer.js +33 -40
  58. package/plugins/prevent_credential_leaks.js +7 -5
  59. package/plugins/process_title.js +16 -17
  60. package/plugins/queue/deliver.js +2 -2
  61. package/plugins/queue/lmtp.js +5 -6
  62. package/plugins/queue/qmail-queue.js +11 -13
  63. package/plugins/queue/quarantine.js +25 -34
  64. package/plugins/queue/rabbitmq.js +3 -2
  65. package/plugins/queue/rabbitmq_amqplib.js +9 -9
  66. package/plugins/queue/smtp_bridge.js +5 -4
  67. package/plugins/queue/smtp_forward.js +81 -89
  68. package/plugins/queue/smtp_proxy.js +21 -22
  69. package/plugins/queue/test.js +2 -1
  70. package/plugins/rcpt_to.host_list_base.js +20 -30
  71. package/plugins/rcpt_to.in_host_list.js +12 -14
  72. package/plugins/rcpt_to.max_count.js +7 -5
  73. package/plugins/record_envelope_addresses.js +4 -6
  74. package/plugins/relay.js +64 -74
  75. package/plugins/reseed_rng.js +1 -2
  76. package/plugins/spamassassin.js +56 -68
  77. package/plugins/status.js +2 -3
  78. package/plugins/tarpit.js +8 -11
  79. package/plugins/tls.js +14 -17
  80. package/plugins/toobusy.js +6 -8
  81. package/plugins/xclient.js +14 -25
  82. package/plugins.js +24 -29
  83. package/rfc1869.js +2 -2
  84. package/server.js +3 -13
  85. package/smtp_client.js +138 -215
  86. package/tests/config/smtp_forward.ini +0 -6
  87. package/tests/fixtures/line_socket.js +1 -1
  88. package/tests/fixtures/util_hmailitem.js +5 -7
  89. package/tests/fixtures/vm_harness.js +2 -2
  90. package/tests/host_pool.js +13 -14
  91. package/tests/installation/plugins/inherits.js +1 -2
  92. package/tests/logger.js +2 -2
  93. package/tests/plugins/bounce.js +6 -8
  94. package/tests/plugins/dkim_signer.js +7 -7
  95. package/tests/plugins/dns_list_base.js +7 -7
  96. package/tests/plugins/helo.checks.js +1 -1
  97. package/tests/plugins/mail_from.is_resolvable.js +10 -54
  98. package/tests/plugins/queue/smtp_forward.js +11 -11
  99. package/tests/plugins/rcpt_to.host_list_base.js +1 -1
  100. package/tests/plugins/rcpt_to.in_host_list.js +1 -1
  101. package/tests/plugins/spamassassin.js +1 -1
  102. package/tests/queue/multibyte +0 -0
  103. package/tests/queue/plain +0 -0
  104. package/tests/rfc1869.js +4 -1
  105. package/tests/server.js +15 -9
  106. package/tests/smtp_client/auth.js +4 -14
  107. package/tests/smtp_client/basic.js +5 -15
  108. package/tests/smtp_client.js +7 -3
  109. package/tests/transaction.js +72 -19
  110. package/tls_socket.js +75 -85
  111. package/transaction.js +7 -9
  112. package/attachment_stream.js +0 -118
  113. package/bin/spf +0 -48
  114. package/chunkemitter.js +0 -75
  115. package/config/data.uribl.excludes +0 -202
  116. package/config/data.uribl.ini +0 -37
  117. package/config/spf.ini +0 -1
  118. package/docs/plugins/attachment.md +0 -92
  119. package/docs/plugins/data.uribl.md +0 -120
  120. package/docs/plugins/spf.md +0 -142
  121. package/mailbody.js +0 -502
  122. package/mailheader.js +0 -304
  123. package/messagestream.js +0 -441
  124. package/plugins/aliases.js +0 -120
  125. package/plugins/attachment.js +0 -503
  126. package/plugins/connect.p0f.js +0 -5
  127. package/plugins/spf.js +0 -327
  128. package/spf.js +0 -689
  129. package/tests/mailbody.js +0 -348
  130. package/tests/mailheader.js +0 -138
  131. package/tests/messagestream.js +0 -34
  132. package/tests/plugins/aliases.js +0 -376
  133. package/tests/plugins/spf.js +0 -251
  134. package/tests/spf.js +0 -96
package/.eslintrc.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  env:
2
2
  es6: true
3
3
  node: true
4
-
5
- parserOptions:
6
- #ecmaVersion: 2015 (6)
7
- #ecmaVersion: 2016 (7) (node 6)
8
- #ecmaVersion: 2017 (8) (node 8)
9
- ecmaVersion: 2017
10
- #ecmaVersion: 2018 (9) (node 10)
11
- #ecmaVersion: 2019 (10) (node 12)
12
- #ecmaVersion: 2020 (11) (node 14)
4
+ es2020: true
13
5
 
14
6
  plugins:
15
7
  - haraka
@@ -17,7 +9,7 @@ plugins:
17
9
  root: true
18
10
 
19
11
  rules:
20
- semi-style: [error, last]
12
+ semi-style: [ error, last ]
21
13
  prefer-template: "warn"
22
14
  no-unneeded-ternary: 1
23
15
 
package/Changes.md CHANGED
@@ -1,5 +1,68 @@
1
1
 
2
- ## NEXT - 2021-MM-DD
2
+ ### Unreleased
3
+
4
+ ### [3.0.0] - 2022-12-17
5
+
6
+ #### Added
7
+
8
+ - feat: prevent local delivery loop when target exchange resolves to a local hostname #3002
9
+ - feat: format DKIM signature to multiline #2991
10
+
11
+ #### Fixed
12
+
13
+ - fix(tls): redis promise syntax for tls & ob/tls #3064
14
+ - fix(attachment): error handling with complex archive #3035
15
+ - fix(smtp_client): run "secured" once, fixes #3020
16
+ - fix(smtp_client): add missing `$` char in front of interpolated string
17
+ - fix(auth_proxy): run "secured" only once, improvement for #3022
18
+ - fix(helo): remove multi-check from should_skip #3041
19
+ - fix(outbound): outbound local mx check #3010
20
+ - fix(outbound): prevent delivery loop when target MX resolves to local hostname #3002
21
+ - fix(conn): socket can't be released when disconnect after DATA command #2994
22
+
23
+ #### Changed
24
+
25
+ - dep(generic-pool): remove pooling from outbound #3115
26
+ - smtp_client: disable pooling in get_client_plugin, #3113
27
+ - smtp_forward: restore ability to enable queue_outbound #3119
28
+ - ./mailbody & ./mailheader moved to haraka-email-message #3071
29
+ - config/plugins: update name of uribl plugin
30
+ - doc(queue.js) spelling & grammar improvement #3051
31
+ - doc(rails): add haraka-plugin-queue-rails #2995
32
+ - doc(smtp.ini): correct spelling of SMTPUTF8 #2993
33
+ - style(es6): use optional chaining when accessing transactions #2732
34
+ - style(smtp_client): pass args as objects (was positional)
35
+ - style(plugin/\*): transaction guarding #3032
36
+ - dep(spf): remove to separate plugin #3078
37
+ - dep(iconv): removed, declared in haraka-email-message)
38
+ - dep(haraka-plugin-redis)!: 1.0 -> 2.0 #3038
39
+ - dep(redis)!: 3.1 -> 4.1 #3058
40
+ - dep(generic-pool): remove pooling from outbound #3115
41
+ - smtp_client: remove smtp_\* pooling support in #3113
42
+ - dep: bump plugin versions #3063
43
+ - dep: bump haraka-plugin-asn from 1.0.9 to 2.0.0 #3062
44
+ - dep(redis): 3.1 -> 4.1 #3058
45
+ - dep(nopt): 5 -> 6.0.0 #3076
46
+ - dep(haraka-plugin-fcrdns): 1.0.3 -> 1.1.0 #3076
47
+ - dep(haraka-plugin-redis): 1.0 -> 2.0 #3038
48
+ - dep(nodemailer): 6.7.0 to 6.7.2 #3000, #3004
49
+ - dep: add explicit dependency on node-gyp 9
50
+ - ci: github action tweaks #3047
51
+ - chore: transaction guarding #3032
52
+ - ci: enable windows node 16 testing #3036
53
+ - chore: update phusion image #2988
54
+ - chore: add lots of `if (!transaction) return` in places #2732
55
+ - chore(test): build shims for windows-2022 & node on windows #3052
56
+ - chore(test): restore CI tests to working order #3030
57
+ - dkim_sign: reformat dkim signature to multi-line #2991
58
+ - dkim_sign: remove spurious error logging #3034
59
+ - tls: add force_tls option to the ToDo object
60
+ - fix(banner): banner was inserted erroneously into text attachments
61
+ - outbound: remove hardcoded AUTH PLAIN authorization identity
62
+ - outbound: set acquireTimeoutMillis to prevent constant reconnect to unreachable servers
63
+ - style(smtp_client): pass args as objects (was positional)
64
+ - uribl: timeout DNS 1 second before plugin, #3077
65
+ - uribl: load .ini config to plugin.cfg, add basic tests #3077
3
66
 
4
67
 
5
68
  ## 2.8.28 - 2021-10-14
@@ -14,7 +77,7 @@
14
77
  - spamassassin: allow returning DENYSOFT on errors #2967
15
78
  - dep: use caret version range for all dependencies #2965
16
79
  - outbound: disable outbound to localhost by default #2952
17
- - connection error logging: use key-value paris #2921
80
+ - connection error logging: use key-value pairs #2921
18
81
  - tls: change default to NOT send TLS client certs #2902
19
82
  - dep: redis is now a dependency #2896
20
83
  - use address-rfc2821 2.0.0
@@ -1263,3 +1326,6 @@
1263
1326
  * Small fixes to data.uribl
1264
1327
 
1265
1328
  ## 1.4.0 -
1329
+
1330
+
1331
+ [3.0.0]: https://github.com/haraka/Haraka/releases/tag/3.0.0
package/Dockerfile CHANGED
@@ -13,7 +13,7 @@
13
13
  # DOCKER-VERSION 0.5.3
14
14
 
15
15
  # See http://phusion.github.io/baseimage-docker/
16
- FROM phusion/baseimage:latest
16
+ FROM phusion/baseimage:master
17
17
 
18
18
  MAINTAINER Justin Plock <jplock@gmail.com>
19
19
 
package/Plugins.md CHANGED
@@ -42,7 +42,7 @@ Create a PR adding yours to this list.
42
42
  | [clamd][url-clamd] | Anti-Virus scanning with ClamAV |
43
43
  | [connect.p0f][url-p0f] | TCP Fingerprinting |
44
44
  | [data.signatures][url-sigs] | Block emails whose bodies match signatures |
45
- | [data.uribl][url-uribl] | Block based on URI blacklists |
45
+ | [uribl][url-uribl] | Block based on URI blacklists |
46
46
  | [dcc][url-dcc] | Distributed Checksum Clearinghouse |
47
47
  | [delay_deny][url-delay] | Delays all pre-DATA 'deny' results |
48
48
  | [dkim_sign][url-sign] | DKIM sign outbound messages |
@@ -77,6 +77,7 @@ Create a PR adding yours to this list.
77
77
  | queue/[quarantine][url-qquart] | queue to a quarantine directory |
78
78
  | queue/[rabbitmq][url-qrabbit] | queue to RabbitMQ |
79
79
  | queue/[rabbitmq_amqplib][url-qrabbita] | queue to RabbitMQ using amqplib |
80
+ | queue/[rails][url-qrails] | queue messages to a Rails app using [Action Mailbox][url-action-mailbox] |
80
81
  | queue/[smtp_bridge][url-qbridge] | Bridge SMTP sessions to another MTA |
81
82
  | queue/[smtp_forward][url-qforward] | Forward emails to another MTA |
82
83
  | queue/[smtp_proxy][url-qproxy] | Proxy SMTP connections to another MTA |
@@ -110,9 +111,10 @@ Create a PR adding yours to this list.
110
111
  [plugins-doc]: https://haraka.github.io/manual/Plugins.html
111
112
  [url-access]: https://github.com/haraka/haraka-plugin-access
112
113
  [url-acc-files]: https://github.com/acharkizakaria/haraka-plugin-accounting-files/blob/master/README.md
114
+ [url-action-mailbox]: https://guides.rubyonrails.org/action_mailbox_basics.html
113
115
  [url-aliases]: https://github.com/haraka/Haraka/blob/master/docs/plugins/aliases.md
114
116
  [url-asn]: https://github.com/haraka/haraka-plugin-asn
115
- [url-attach]: https://github.com/haraka/Haraka/blob/master/docs/plugins/attachment.md
117
+ [url-attach]: https://github.com/haraka/haraka-plugin-attachment
116
118
  [url-authencflat]: https://github.com/AuspeXeu/haraka-plugin-auth-enc-file
117
119
  [url-authflat]: https://github.com/haraka/Haraka/blob/master/docs/plugins/auth/flat_file.md
118
120
  [url-authbridge]: https://github.com/haraka/Haraka/blob/master/docs/plugins/auth/auth_bridge.md
@@ -130,7 +132,7 @@ Create a PR adding yours to this list.
130
132
  [url-p0f]: https://github.com/haraka/haraka-plugin-p0f
131
133
  [url-headers]: https://github.com/haraka/haraka-plugin-headers
132
134
  [url-sigs]: https://github.com/haraka/Haraka/blob/master/docs/plugins/data.signatures.md
133
- [url-uribl]: https://github.com/haraka/Haraka/blob/master/docs/plugins/data.uribl.md
135
+ [url-uribl]: https://github.com/haraka/haraka-plugin-uribl
134
136
  [url-dcc]: https://github.com/haraka/haraka-plugin-dcc
135
137
  [url-delay]: https://github.com/haraka/Haraka/blob/master/docs/plugins/delay_deny.md
136
138
  [url-sign]: https://github.com/haraka/Haraka/blob/master/docs/plugins/dkim_sign.md
@@ -167,6 +169,7 @@ Create a PR adding yours to this list.
167
169
  [url-qbridge]: https://github.com/haraka/Haraka/blob/master/docs/plugins/queue/smtp_bridge.md
168
170
  [url-qforward]: https://github.com/haraka/Haraka/blob/master/docs/plugins/queue/smtp_forward.md
169
171
  [url-qproxy]: https://github.com/haraka/Haraka/blob/master/docs/plugins/queue/smtp_proxy.md
172
+ [url-qrails]: https://github.com/mailprotector/haraka-plugin-queue-rails
170
173
  [url-redis]: https://github.com/haraka/haraka-plugin-redis
171
174
  [url-rhost]: https://github.com/haraka/Haraka/blob/master/docs/plugins/rcpt_to.in_host_list.md
172
175
  [url-rcpt-ldap]: https://github.com/haraka/haraka-plugin-rcpt-ldap
@@ -177,7 +180,7 @@ Create a PR adding yours to this list.
177
180
  [url-rng]: https://github.com/haraka/Haraka/blob/master/docs/plugins/reseed_rng.md
178
181
  [url-rspamd]: https://github.com/haraka/haraka-plugin-rspamd
179
182
  [url-spamass]: https://github.com/haraka/Haraka/blob/master/docs/plugins/spamassassin.md
180
- [url-spf]: https://github.com/haraka/Haraka/blob/master/docs/plugins/spf.md
183
+ [url-spf]: https://github.com/haraka/haraka-plugin-spf
181
184
  [url-srs]: https://github.com/swerter/haraka-plugins/blob/master/plugins/srs.js
182
185
  [url-tarpit]: https://github.com/haraka/Haraka/blob/master/docs/plugins/tarpit.md
183
186
  [url-tls]: https://github.com/haraka/Haraka/blob/master/docs/plugins/tls.md
package/README.md CHANGED
@@ -2,8 +2,7 @@
2
2
  Haraka - a Node.js Mail Server
3
3
  ------------------------------
4
4
 
5
- ![Tests](https://github.com/haraka/Haraka/workflows/Haraka%20Tests/badge.svg)
6
- ![Tests - Windows](https://github.com/haraka/Haraka/workflows/Haraka%20Tests%20-%20Windows/badge.svg)
5
+ ![Tests](https://github.com/haraka/Haraka/actions/workflows/ci.yml/badge.svg)
7
6
  [![Coverage Status][cov-img]][cov-url]
8
7
 
9
8
 
@@ -28,7 +27,6 @@ queued for outbound delivery.
28
27
  ### Getting Help
29
28
 
30
29
  * [Join the mailing list][8] (implemented as a Haraka plugin)
31
- * [Join us on Slack][14]
32
30
  * [GitHub Issues][15]
33
31
 
34
32
 
@@ -131,8 +129,7 @@ Finally run Haraka:
131
129
 
132
130
  Haraka is MIT licensed - see the [LICENSE][16] file for details.
133
131
 
134
- Haraka is a project started by [Matt Sergeant][17], a 10 year veteran of the email
135
- and anti-spam world. Previous projects have been the project leader for
132
+ Haraka is a project started by [Matt Sergeant][17], a 10 year veteran of the email and anti-spam world. Previous projects have been the project leader for
136
133
  SpamAssassin and a hacker on [Qpsmtpd][13].
137
134
 
138
135
  [1]: http://nodejs.org/
@@ -148,7 +145,6 @@ SpamAssassin and a hacker on [Qpsmtpd][13].
148
145
  [11]: https://haraka.github.io/manual/plugins/dnsbl.html
149
146
  [12]: https://github.com/haraka/Haraka/tree/master/plugins
150
147
  [13]: https://github.com/smtpd/qpsmtpd/
151
- [14]: https://communityinviter.com/apps/harakaserver/public-inviter
152
148
  [15]: https://github.com/haraka/Haraka/issues
153
149
  [16]: https://github.com/haraka/Haraka/blob/master/LICENSE
154
150
  [17]: https://github.com/baudehlo
@@ -21,10 +21,3 @@
21
21
 
22
22
  ; received_header (default: "Haraka outbound")
23
23
  ; received_header=Haraka outbound
24
-
25
- ; pool_timeout: default : 300
26
- ; pool_timeout=0
27
-
28
- ; pool_concurrency_max: default: 10
29
- ; set to zero to disable pools
30
- ; pool_concurrency_max=0
package/config/plugins CHANGED
@@ -56,7 +56,7 @@ rcpt_to.in_host_list
56
56
  #bounce
57
57
  # Check mail headers are valid
58
58
  headers
59
- #data.uribl
59
+ #uribl
60
60
  #attachment
61
61
  #clamd
62
62
  #spamassassin
package/config/smtp.ini CHANGED
@@ -47,7 +47,7 @@
47
47
  ; SMTP service extensions: https://tools.ietf.org/html/rfc1869
48
48
  ; strict_rfc1869 = false
49
49
 
50
- ; Advertise support for SMTPTUF8 (RFC-6531)
50
+ ; Advertise support for SMTPUTF8 (RFC-6531)
51
51
  ;smtputf8=true
52
52
 
53
53
  [headers]
@@ -4,12 +4,6 @@ host=localhost
4
4
  ; port to connect to
5
5
  port=2555
6
6
  ;
7
- ; timeout backend connection from pool
8
- ;timeout=300
9
- ;
10
- ; max connections in pool
11
- ;max_connections=1000
12
- ;
13
7
  ; uncomment to enable TLS to the backend SMTP server
14
8
  ;enable_tls=true
15
9
  ;
@@ -23,5 +17,5 @@ port=2555
23
17
  ;auth_pass=
24
18
 
25
19
  ; should outbound messages be delivered by smtp_forward?
26
- ; see https://github.com/haraka/Haraka/issues/1472
27
- ; enable_outbound=true
20
+ ; see #1472 and #2795
21
+ ; enable_outbound=false
@@ -4,12 +4,6 @@ host=localhost
4
4
  ; port to connect to
5
5
  port=2555
6
6
  ;
7
- ; timeout backend connection from pool
8
- ;timeout=300
9
- ;
10
- ; max connections in pool
11
- ;max_connections=1000
12
- ;
13
7
  ; uncomment to enable TLS to the backend SMTP server
14
8
  ; enable_tls=1
15
9
  ;