haraka 0.0.33 → 3.3.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 (309) hide show
  1. package/.claude/settings.local.json +28 -0
  2. package/.githooks/pre-commit +41 -0
  3. package/.prettierignore +6 -0
  4. package/.qlty/.gitignore +7 -0
  5. package/.qlty/configs/.shellcheckrc +1 -0
  6. package/.qlty/qlty.toml +15 -0
  7. package/CHANGELOG.md +1894 -0
  8. package/CLAUDE.md +40 -0
  9. package/CONTRIBUTORS.md +34 -0
  10. package/Dockerfile +50 -0
  11. package/GEMINI.md +38 -0
  12. package/LICENSE +22 -0
  13. package/Plugins.md +227 -0
  14. package/README.md +119 -4
  15. package/SECURITY.md +178 -0
  16. package/TODO +22 -0
  17. package/address.js +53 -0
  18. package/bin/haraka +593 -0
  19. package/bin/haraka_grep +32 -0
  20. package/config/aliases +2 -0
  21. package/config/auth_flat_file.ini +7 -0
  22. package/config/auth_vpopmaild.ini +9 -0
  23. package/config/connection.ini +79 -0
  24. package/config/delay_deny.ini +7 -0
  25. package/config/dhparams.pem +8 -0
  26. package/config/host_list +3 -0
  27. package/config/host_list_regex +6 -0
  28. package/config/http.ini +11 -0
  29. package/config/lmtp.ini +7 -0
  30. package/config/log.ini +11 -0
  31. package/config/me +1 -0
  32. package/config/outbound.bounce_message +18 -0
  33. package/config/outbound.bounce_message_html +36 -0
  34. package/config/outbound.bounce_message_image +106 -0
  35. package/config/outbound.ini +24 -0
  36. package/config/plugins +67 -0
  37. package/config/smtp.ini +37 -0
  38. package/config/smtp_bridge.ini +4 -0
  39. package/config/smtp_forward.ini +31 -0
  40. package/config/smtp_proxy.ini +27 -0
  41. package/config/tarpit.timeout +1 -0
  42. package/config/tls.ini +83 -0
  43. package/config/tls_cert.pem +23 -0
  44. package/config/tls_key.pem +28 -0
  45. package/config/watch.ini +12 -0
  46. package/config/xclient.hosts +2 -0
  47. package/connection.js +1863 -0
  48. package/contrib/Haraka.cf +6 -0
  49. package/contrib/Haraka.pm +35 -0
  50. package/contrib/bad_smtp_server.pl +25 -0
  51. package/contrib/bsd-rc.d/haraka +61 -0
  52. package/contrib/debian-init.d/haraka +87 -0
  53. package/contrib/haraka.init +96 -0
  54. package/contrib/haraka.service +23 -0
  55. package/contrib/plugin2npm.sh +81 -0
  56. package/contrib/ubuntu-upstart/haraka.conf +27 -0
  57. package/coverage/coverage-final.json +2 -0
  58. package/coverage/coverage-summary.json +33 -0
  59. package/coverage/tmp/coverage-79131-1779241025146-0.json +1 -0
  60. package/coverage/tmp/coverage-79132-1779240999690-0.json +1 -0
  61. package/coverage/tmp/coverage-79172-1779241000095-0.json +1 -0
  62. package/coverage/tmp/coverage-79210-1779241000156-0.json +1 -0
  63. package/coverage/tmp/coverage-79211-1779241000209-0.json +1 -0
  64. package/coverage/tmp/coverage-79212-1779241000266-0.json +1 -0
  65. package/coverage/tmp/coverage-79213-1779241000441-0.json +1 -0
  66. package/coverage/tmp/coverage-79214-1779241000626-0.json +1 -0
  67. package/coverage/tmp/coverage-79215-1779241000795-0.json +1 -0
  68. package/coverage/tmp/coverage-79216-1779241000965-0.json +1 -0
  69. package/coverage/tmp/coverage-79218-1779241001013-0.json +1 -0
  70. package/coverage/tmp/coverage-79219-1779241001179-0.json +1 -0
  71. package/coverage/tmp/coverage-79220-1779241006249-0.json +1 -0
  72. package/coverage/tmp/coverage-79227-1779241011453-0.json +1 -0
  73. package/coverage/tmp/coverage-79229-1779241011537-0.json +1 -0
  74. package/coverage/tmp/coverage-79230-1779241011647-0.json +1 -0
  75. package/coverage/tmp/coverage-79231-1779241011765-0.json +1 -0
  76. package/coverage/tmp/coverage-79232-1779241011841-0.json +1 -0
  77. package/coverage/tmp/coverage-79233-1779241011909-0.json +1 -0
  78. package/coverage/tmp/coverage-79234-1779241011984-0.json +1 -0
  79. package/coverage/tmp/coverage-79235-1779241012055-0.json +1 -0
  80. package/coverage/tmp/coverage-79236-1779241012230-0.json +1 -0
  81. package/coverage/tmp/coverage-79237-1779241012300-0.json +1 -0
  82. package/coverage/tmp/coverage-79238-1779241012368-0.json +1 -0
  83. package/coverage/tmp/coverage-79239-1779241012438-0.json +1 -0
  84. package/coverage/tmp/coverage-79240-1779241012511-0.json +1 -0
  85. package/coverage/tmp/coverage-79241-1779241012582-0.json +1 -0
  86. package/coverage/tmp/coverage-79242-1779241012652-0.json +1 -0
  87. package/coverage/tmp/coverage-79243-1779241012814-0.json +1 -0
  88. package/coverage/tmp/coverage-79244-1779241012931-0.json +1 -0
  89. package/coverage/tmp/coverage-79245-1779241013007-0.json +1 -0
  90. package/coverage/tmp/coverage-79246-1779241013106-0.json +1 -0
  91. package/coverage/tmp/coverage-79247-1779241013178-0.json +1 -0
  92. package/coverage/tmp/coverage-79248-1779241013244-0.json +1 -0
  93. package/coverage/tmp/coverage-79249-1779241013409-0.json +1 -0
  94. package/coverage/tmp/coverage-79250-1779241013697-0.json +1 -0
  95. package/coverage/tmp/coverage-79251-1779241013847-0.json +1 -0
  96. package/coverage/tmp/coverage-79252-1779241014288-0.json +1 -0
  97. package/coverage/tmp/coverage-79253-1779241014378-0.json +1 -0
  98. package/coverage/tmp/coverage-79254-1779241014428-0.json +1 -0
  99. package/coverage/tmp/coverage-79255-1779241021774-0.json +1 -0
  100. package/coverage/tmp/coverage-80382-1779241021949-0.json +1 -0
  101. package/coverage/tmp/coverage-80383-1779241025019-0.json +1 -0
  102. package/coverage/tmp/coverage-80384-1779241025133-0.json +1 -0
  103. package/docs/Body.md +1 -0
  104. package/docs/Config.md +1 -0
  105. package/docs/Connection.md +153 -0
  106. package/docs/CoreConfig.md +96 -0
  107. package/docs/CustomReturnCodes.md +3 -0
  108. package/docs/HAProxy.md +62 -0
  109. package/docs/Header.md +1 -0
  110. package/docs/Logging.md +129 -0
  111. package/docs/Outbound.md +210 -0
  112. package/docs/Plugins.md +372 -0
  113. package/docs/Results.md +7 -0
  114. package/docs/Transaction.md +135 -0
  115. package/docs/Tutorial.md +183 -0
  116. package/docs/deprecated/access.md +3 -0
  117. package/docs/deprecated/backscatterer.md +9 -0
  118. package/docs/deprecated/connect.rdns_access.md +53 -0
  119. package/docs/deprecated/data.headers.md +3 -0
  120. package/docs/deprecated/data.nomsgid.md +7 -0
  121. package/docs/deprecated/data.noreceived.md +11 -0
  122. package/docs/deprecated/data.rfc5322_header_checks.md +11 -0
  123. package/docs/deprecated/dkim_sign.md +97 -0
  124. package/docs/deprecated/dkim_verify.md +28 -0
  125. package/docs/deprecated/dnsbl.md +80 -0
  126. package/docs/deprecated/dnswl.md +73 -0
  127. package/docs/deprecated/lookup_rdns.strict.md +67 -0
  128. package/docs/deprecated/mail_from.access.md +52 -0
  129. package/docs/deprecated/mail_from.blocklist.md +18 -0
  130. package/docs/deprecated/mail_from.nobounces.md +8 -0
  131. package/docs/deprecated/rcpt_to.access.md +53 -0
  132. package/docs/deprecated/rcpt_to.blocklist.md +18 -0
  133. package/docs/deprecated/rcpt_to.routes.md +3 -0
  134. package/docs/deprecated/rdns.regexp.md +30 -0
  135. package/docs/plugins/aliases.md +3 -0
  136. package/docs/plugins/auth/auth_bridge.md +34 -0
  137. package/docs/plugins/auth/auth_ldap.md +4 -0
  138. package/docs/plugins/auth/auth_proxy.md +36 -0
  139. package/docs/plugins/auth/auth_vpopmaild.md +33 -0
  140. package/docs/plugins/auth/flat_file.md +40 -0
  141. package/docs/plugins/block_me.md +18 -0
  142. package/docs/plugins/data.signatures.md +11 -0
  143. package/docs/plugins/delay_deny.md +23 -0
  144. package/docs/plugins/max_unrecognized_commands.md +6 -0
  145. package/docs/plugins/prevent_credential_leaks.md +22 -0
  146. package/docs/plugins/process_title.md +42 -0
  147. package/docs/plugins/queue/deliver.md +3 -0
  148. package/docs/plugins/queue/discard.md +32 -0
  149. package/docs/plugins/queue/lmtp.md +24 -0
  150. package/docs/plugins/queue/qmail-queue.md +16 -0
  151. package/docs/plugins/queue/quarantine.md +87 -0
  152. package/docs/plugins/queue/smtp_bridge.md +32 -0
  153. package/docs/plugins/queue/smtp_forward.md +127 -0
  154. package/docs/plugins/queue/smtp_proxy.md +68 -0
  155. package/docs/plugins/queue/test.md +7 -0
  156. package/docs/plugins/rcpt_to.in_host_list.md +34 -0
  157. package/docs/plugins/rcpt_to.max_count.md +3 -0
  158. package/docs/plugins/record_envelope_addresses.md +20 -0
  159. package/docs/plugins/relay.md +3 -0
  160. package/docs/plugins/reseed_rng.md +16 -0
  161. package/docs/plugins/status.md +41 -0
  162. package/docs/plugins/tarpit.md +50 -0
  163. package/docs/plugins/tls.md +235 -0
  164. package/docs/plugins/toobusy.md +27 -0
  165. package/docs/plugins/xclient.md +10 -0
  166. package/docs/tutorials/Migrating_from_v1_to_v2.md +96 -0
  167. package/docs/tutorials/SettingUpOutbound.md +62 -0
  168. package/eslint.config.mjs +2 -0
  169. package/haraka.js +74 -0
  170. package/haraka.sh +2 -0
  171. package/http/html/404.html +58 -0
  172. package/http/html/index.html +47 -0
  173. package/http/package.json +21 -0
  174. package/line_socket.js +24 -0
  175. package/logger.js +322 -0
  176. package/outbound/client_pool.js +59 -0
  177. package/outbound/config.js +134 -0
  178. package/outbound/hmail.js +1504 -0
  179. package/outbound/index.js +349 -0
  180. package/outbound/qfile.js +93 -0
  181. package/outbound/queue.js +399 -0
  182. package/outbound/tls.js +85 -0
  183. package/outbound/todo.js +17 -0
  184. package/package.json +99 -4
  185. package/plugins/.eslintrc.yaml +3 -0
  186. package/plugins/auth/auth_base.js +261 -0
  187. package/plugins/auth/auth_bridge.js +20 -0
  188. package/plugins/auth/auth_proxy.js +227 -0
  189. package/plugins/auth/auth_vpopmaild.js +162 -0
  190. package/plugins/auth/flat_file.js +44 -0
  191. package/plugins/block_me.js +88 -0
  192. package/plugins/data.signatures.js +30 -0
  193. package/plugins/delay_deny.js +153 -0
  194. package/plugins/prevent_credential_leaks.js +61 -0
  195. package/plugins/process_title.js +197 -0
  196. package/plugins/profile.js +11 -0
  197. package/plugins/queue/deliver.js +12 -0
  198. package/plugins/queue/discard.js +27 -0
  199. package/plugins/queue/lmtp.js +45 -0
  200. package/plugins/queue/qmail-queue.js +93 -0
  201. package/plugins/queue/quarantine.js +133 -0
  202. package/plugins/queue/smtp_bridge.js +45 -0
  203. package/plugins/queue/smtp_forward.js +371 -0
  204. package/plugins/queue/smtp_proxy.js +142 -0
  205. package/plugins/queue/test.js +15 -0
  206. package/plugins/rcpt_to.host_list_base.js +65 -0
  207. package/plugins/rcpt_to.in_host_list.js +56 -0
  208. package/plugins/record_envelope_addresses.js +17 -0
  209. package/plugins/reseed_rng.js +7 -0
  210. package/plugins/status.js +274 -0
  211. package/plugins/tarpit.js +45 -0
  212. package/plugins/tls.js +164 -0
  213. package/plugins/toobusy.js +47 -0
  214. package/plugins/xclient.js +124 -0
  215. package/plugins.js +604 -0
  216. package/queue/1772642154987_1775581346001_4_82235_TGwgfd_2_mattbook-m3.home.simerson.net +0 -0
  217. package/run_tests +11 -0
  218. package/server.js +827 -0
  219. package/smtp_client.js +504 -0
  220. package/test/.eslintrc.yaml +11 -0
  221. package/test/config/auth_flat_file.ini +5 -0
  222. package/test/config/block_me.recipient +1 -0
  223. package/test/config/block_me.senders +1 -0
  224. package/test/config/dhparams.pem +8 -0
  225. package/test/config/host_list +2 -0
  226. package/test/config/outbound_tls_cert.pem +1 -0
  227. package/test/config/outbound_tls_key.pem +1 -0
  228. package/test/config/plugins +7 -0
  229. package/test/config/smtp.ini +11 -0
  230. package/test/config/smtp_forward.ini +30 -0
  231. package/test/config/tls/example.com/_.example.com.key +28 -0
  232. package/test/config/tls/example.com/example.com.crt +25 -0
  233. package/test/config/tls/haraka.local.pem +51 -0
  234. package/test/config/tls.ini +45 -0
  235. package/test/config/tls_cert.pem +21 -0
  236. package/test/config/tls_key.pem +28 -0
  237. package/test/connection.js +817 -0
  238. package/test/fixtures/haproxy_allowed/config/connection.ini +3 -0
  239. package/test/fixtures/haproxy_disabled/config/connection.ini +3 -0
  240. package/test/fixtures/haproxy_untrusted/config/connection.ini +3 -0
  241. package/test/fixtures/line_socket.js +21 -0
  242. package/test/fixtures/todo_qfile.txt +0 -0
  243. package/test/fixtures/util_hmailitem.js +156 -0
  244. package/test/installation/config/test-plugin-flat +1 -0
  245. package/test/installation/config/test-plugin.ini +10 -0
  246. package/test/installation/config/tls.ini +1 -0
  247. package/test/installation/node_modules/load_first/index.js +5 -0
  248. package/test/installation/node_modules/load_first/package.json +11 -0
  249. package/test/installation/node_modules/test-plugin/config/test-plugin-flat +1 -0
  250. package/test/installation/node_modules/test-plugin/config/test-plugin.ini +9 -0
  251. package/test/installation/node_modules/test-plugin/package.json +5 -0
  252. package/test/installation/node_modules/test-plugin/test-plugin.js +5 -0
  253. package/test/installation/plugins/base_plugin.js +3 -0
  254. package/test/installation/plugins/folder_plugin/index.js +3 -0
  255. package/test/installation/plugins/folder_plugin/package.json +11 -0
  256. package/test/installation/plugins/inherits.js +7 -0
  257. package/test/installation/plugins/load_first.js +3 -0
  258. package/test/installation/plugins/plugin.js +1 -0
  259. package/test/installation/plugins/tls.js +3 -0
  260. package/test/logger.js +217 -0
  261. package/test/loud/config/dhparams.pem +0 -0
  262. package/test/loud/config/tls/goobered.pem +45 -0
  263. package/test/loud/config/tls.ini +43 -0
  264. package/test/mail_specimen/base64-root-part.txt +23 -0
  265. package/test/mail_specimen/varied-fold-lengths-preserve-data.txt +283 -0
  266. package/test/outbound/bounce_net_errors.js +133 -0
  267. package/test/outbound/bounce_rfc3464.js +226 -0
  268. package/test/outbound/hmail.js +210 -0
  269. package/test/outbound/index.js +385 -0
  270. package/test/outbound/qfile.js +124 -0
  271. package/test/outbound/queue.js +325 -0
  272. package/test/plugins/auth/auth_base.js +620 -0
  273. package/test/plugins/auth/auth_bridge.js +80 -0
  274. package/test/plugins/auth/auth_vpopmaild.js +81 -0
  275. package/test/plugins/auth/flat_file.js +123 -0
  276. package/test/plugins/block_me.js +141 -0
  277. package/test/plugins/data.signatures.js +111 -0
  278. package/test/plugins/delay_deny.js +262 -0
  279. package/test/plugins/prevent_credential_leaks.js +174 -0
  280. package/test/plugins/process_title.js +141 -0
  281. package/test/plugins/queue/deliver.js +98 -0
  282. package/test/plugins/queue/discard.js +78 -0
  283. package/test/plugins/queue/lmtp.js +137 -0
  284. package/test/plugins/queue/qmail-queue.js +98 -0
  285. package/test/plugins/queue/quarantine.js +80 -0
  286. package/test/plugins/queue/smtp_bridge.js +152 -0
  287. package/test/plugins/queue/smtp_forward.js +1023 -0
  288. package/test/plugins/queue/smtp_proxy.js +138 -0
  289. package/test/plugins/rcpt_to.host_list_base.js +102 -0
  290. package/test/plugins/rcpt_to.in_host_list.js +186 -0
  291. package/test/plugins/record_envelope_addresses.js +66 -0
  292. package/test/plugins/reseed_rng.js +34 -0
  293. package/test/plugins/status.js +207 -0
  294. package/test/plugins/tarpit.js +90 -0
  295. package/test/plugins/tls.js +86 -0
  296. package/test/plugins/toobusy.js +21 -0
  297. package/test/plugins/xclient.js +119 -0
  298. package/test/plugins.js +230 -0
  299. package/test/queue/1507509981169_1507509981169_0_61403_e0Y0Ym_1_fixed +0 -0
  300. package/test/queue/1507509981169_1507509981169_0_61403_e0Y0Ym_1_haraka +0 -0
  301. package/test/queue/1508269674999_1508269674999_0_34002_socVUF_1_haraka +0 -0
  302. package/test/queue/1508455115683_1508455115683_0_90253_9Q4o4V_1_haraka +0 -0
  303. package/test/queue/zero-length +0 -0
  304. package/test/server.js +1012 -0
  305. package/test/smtp_client.js +1303 -0
  306. package/test/tls_socket.js +321 -0
  307. package/test/transaction.js +554 -0
  308. package/tls_socket.js +771 -0
  309. package/transaction.js +267 -0
@@ -0,0 +1,18 @@
1
+ # mail_from.blocklist
2
+
3
+ ## DEPRECATED
4
+
5
+ This plugin is deprecated. Use instead the mail_from.access plugin, which
6
+ does everything this one does and much more. (whitelists, blacklists, regex)
7
+
8
+ This plugin blocks MAIL_FROM addresses in a list.
9
+
10
+ NOTE: If all you need is to deny mail based on the exact address, this plugin
11
+ will work just fine. If you want to customize the deny message, add blocks
12
+ based on a regex, or add whitelists, please use the mail_from.access plugin.
13
+
14
+ ## Configuration
15
+
16
+ - mail_from.blocklist
17
+
18
+ Contains a list of email addresses to block.
@@ -0,0 +1,8 @@
1
+ # mail_from.nobounces
2
+
3
+ This mail blocks all bounce messages using the simple rule of checking
4
+ for `MAIL FROM:<>`.
5
+
6
+ This is useful to enable if you have a mail server that gets spoofed too
7
+ much but very few legitimate users. It is potentially bad to block all
8
+ bounce messages, but unfortunately for some hosts, sometimes necessary.
@@ -0,0 +1,53 @@
1
+ ## DEPRECATION NOTICE
2
+
3
+ See [haraka-plugin-access](https://github.com/haraka/haraka-plugin-access)
4
+ for upgrade instructions.
5
+
6
+ # rcpt_to.access
7
+
8
+ This plugin blocks RCPT_TO addresses in a list or regex.
9
+ This plugin will evaluate the RCPT_TO address against a set of white and black
10
+ lists. The lists are applied in the following way:
11
+
12
+ rcpt_to.access.whitelist (pass)
13
+ rcpt_to.access.whitelist_regex (pass)
14
+ rcpt_to.access.blacklist (block)
15
+ rcpt_to.access.blacklist_regex (block)
16
+
17
+ ## Configuration rcpt_to.access.ini
18
+
19
+ General configuration file for this plugin.
20
+
21
+ - rcpt_to.access.general.deny_msg
22
+
23
+ Text to send the user on reject (text).
24
+
25
+ ## Configuration rcpt_to.access.whitelist
26
+
27
+ The whitelist is mostly to counter blacklist entries that match more than
28
+ what one would want. This file should be used for a specific address
29
+ one per line, that should bypass blacklist checks.
30
+ NOTE: We heavily suggest tailoring blacklist entries to be as accurate as
31
+ possible and never using whitelists. Nevertheless, if you need whitelists,
32
+ here they are.
33
+
34
+ ## Configuration rcpt_to.access.whitelist_regex
35
+
36
+ Does the same thing as the whitelist file, but each line is a regex.
37
+ Each line is also anchored for you, meaning '^' + regex + '$' is added for
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
40
+ from writing overly permissive rules on accident.
41
+
42
+ ## Configuration rcpt_to.access.blacklist
43
+
44
+ This file should be used for a specific address, one per line, that should
45
+ fail on connect.
46
+
47
+ ## Configuration rcpt_to.access.blacklist_regex
48
+
49
+ Does the same thing as the blacklist file, but each line is a regex.
50
+ Each line is also anchored for you, meaning '^' + regex + '$' is added for
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
53
+ from writing overly permissive rules on accident.
@@ -0,0 +1,18 @@
1
+ # rcpt_to.blocklist
2
+
3
+ ## DEPRECATED
4
+
5
+ This plugin is deprecated. Use instead the rcpt_to.access plugin, which
6
+ does everything this one does and much more. (whitelists, blacklists, regex)
7
+
8
+ This plugin blocks RCPT_TO addresses in a list.
9
+
10
+ NOTE: If all you need is to deny mail based on the exact address, this plugin
11
+ will work just fine. If you want to customize the deny message, add blocks
12
+ based on a regex, or add whitelists, please use the rcpt_to.access plugin.
13
+
14
+ ## Configuration
15
+
16
+ - rcpt_to.blocklist
17
+
18
+ Contains a list of email addresses to block.
@@ -0,0 +1,3 @@
1
+ # rcpt_to.routes
2
+
3
+ Moved to [https://github.com/haraka/haraka-plugin-recipient-routes](https://github.com/haraka/haraka-plugin-recipient-routes)
@@ -0,0 +1,30 @@
1
+ # rdns.regexp
2
+
3
+ WARNING: The services offered by this plugin, and much more, are now provided
4
+ more efficiently with the connect.rdns_access plugin. Please transition over
5
+ to using the new connect.rdns_access plugin, as this plugin is now deprecated
6
+ and may be removed in a future version of Haraka.
7
+
8
+ This plugin checks the reverse-DNS against a list of regular expressions. Any
9
+ matches will result in a rejection, unless there is an allow rule to
10
+ balance off broad regexes.
11
+
12
+ To give an example. Assume we add a rule to deny all hosts with dynamic
13
+ in the rDNS hostname (._dynamic._). Now we find a mail server,
14
+ generaldynamics.com that is clearly a false positive. We could try
15
+ to correct the original regex (clearly it is a poorly written regex), or
16
+ we could add an allow rule for generaldynamics.com (.\*generaldynamics\.com$).
17
+ This means that even though the dynamic block rule matches, it will be
18
+ superseded by the allow rule for generaldynamics.com.
19
+
20
+ ## Configuration
21
+
22
+ - rdns.deny_regexps
23
+
24
+ The list of regular expressions to deny. Over broad regexes in this list
25
+ can be corrected by using the allow list.
26
+
27
+ - rdns.allow_regexps
28
+
29
+ The list of regular expressions to allow. This list is always processed
30
+ in favor of rules in the deny file.
@@ -0,0 +1,3 @@
1
+ # aliases
2
+
3
+ Repackaged as [haraka-plugin-aliases](https://github.com/haraka/haraka-plugin-aliases).
@@ -0,0 +1,34 @@
1
+ # auth/auth_bridge
2
+
3
+ This plugin allows you to authenticate users to remote SMTP servers
4
+ bridging the original user and password to the remote server,
5
+ and proxy the result back to authenticate the client.
6
+
7
+ This plugin is meant to be used with the plugin `queue/smtp_bridge`.
8
+
9
+ It is different than `auth/auth_proxy` because it doesn't require
10
+ the AUTH user in user@domain.com format, and it doesn't check that
11
+ the domain is the configuration file. This plugins simply takes
12
+ the original user and password and tries to authenticate it in the
13
+ remote SMTP server.
14
+
15
+ ## Configuration
16
+
17
+ Configuration is stored in `config/smtp_bridge.ini` and uses the INI
18
+ style formatting.
19
+
20
+ The configuration of this plugin is simple:
21
+
22
+ host=localhost
23
+ #port=
24
+ #auth_type=
25
+ #priority=10
26
+
27
+ - host: the host where you will be authenticating and posting,
28
+ for example `smtp.host.tld`. This is the only setting required.
29
+
30
+ If needed you can also set
31
+
32
+ - port: default to empty and Haraka will use 25.
33
+
34
+ The options `auth_type` and `priority` will be used by `queue/smtp_bridge`
@@ -0,0 +1,4 @@
1
+ # auth/auth_ldap
2
+
3
+ Repackaged as [haraka-plugin-auth-ldap](https://github.com/haraka/haraka-plugin-auth-ldap).
4
+ Loading `auth/auth_ldap` in `config/plugins` is auto-redirected to `auth-ldap`.
@@ -0,0 +1,36 @@
1
+ # auth/auth_proxy
2
+
3
+ This plugin allows you to authenticate users by domain to remote SMTP servers
4
+ and proxy the result back to authenticate the client.
5
+
6
+ For this to work - the AUTH username _must_ be in user@domain.com format
7
+ regardless as to whether the remote SMTP server requires it in this format.
8
+ The domain part of the username is used to look-up which SMTP servers should
9
+ be used to authenticate users for that domain.
10
+ When sending the AUTH credentials to the remote server, this plugin will try
11
+ and send the full username e.g. user@domain.com first and if this fails it
12
+ will then strip the @domain.com part and just send the unqualified username.
13
+
14
+ Due to the way this plugin works - it can only support PLAIN and LOGIN
15
+ authentication methods and for this reason it requires that STARTTLS be
16
+ used via the tls plugin before it will advertise AUTH capabilities by the
17
+ EHLO command. When connecting to the remote SMTP systems it will always
18
+ attempt STARTTLS if it is offered, but it does _not_ require it, so caution
19
+ should be exercised.
20
+
21
+ ## Configuration
22
+
23
+ Configuration is stored in `config/auth_proxy.ini` and uses the INI
24
+ style formatting.
25
+
26
+ The configuration of this plugin is simple:
27
+
28
+ [domains]
29
+ domain.com = server1.domain.com:587 server2.domain.com
30
+
31
+ Where domain.com is the domain-part of the username equals a list of hosts
32
+ that should be consulted in host:port format. The :port is optional and will
33
+ default to 25. The list of hosts can be space, semi-colon or comma separated.
34
+
35
+ If more than host is specified, then subsequent hosts will only be tested if
36
+ there is some sort of error e.g. timeout, connection or protocol error.
@@ -0,0 +1,33 @@
1
+ # auth/auth_vpopmaild
2
+
3
+ The `auth/vpopmaild` plugin allows SMTP users to authenticate against a vpopmaild daemon.
4
+
5
+ ## Configuration
6
+
7
+ The configuration file is stored in `config/auth_vpopmaild.ini`.
8
+
9
+ ### settings
10
+
11
+ - host: The host/IP that vpopmaild is listening on (default: localhost).
12
+
13
+ - port: The TCP port that vpopmaild is listening on (default: 89).
14
+
15
+ - sysadmin: A colon separated username:password of a vpopmail user with SYSADMIN privileges (see vpopmail/bin/vmoduser -S). This is **only** necessary to support CRAM-MD5 which requires access to the clear text password. On new installs, it's best not to use CRAM-MD5, as it requires storing clear text passwords. Legacy clients with MUAs configured to authenticate with CRAM-MD5 will need this enabled.
16
+
17
+ - constrain_sender: (default: true). For outbound messages (due to successful AUTH), constrain the envelope sender (MAIL FROM) to the same domain as the authenticated user. This setting, combined with `rate_rcpt_sender` in the [limit](https://github.com/haraka/haraka-plugin-limit) plugin can dramatically reduce the amount of backscatter and spam sent when an email account is compromised.
18
+
19
+ ### Per-domain Configuration
20
+
21
+ Additionally, domains can each have their own configuration for connecting
22
+ to vpopmaild. The defaults are the same, so only the differences needs to
23
+ be declared. Example:
24
+
25
+ ```ini
26
+ [example.com]
27
+ host=192.168.0.1
28
+ port=999
29
+
30
+ [example2.com]
31
+ host=192.168.0.2
32
+ sysadmin=postmaster@example2.com:sekret
33
+ ```
@@ -0,0 +1,40 @@
1
+ # auth/flat_file
2
+
3
+ The `auth/flat_file` plugin allows you to create a file containing username and password combinations, and have relaying users authenticate from that file.
4
+
5
+ Note that passwords are stored in clear-text, so this may not be a great idea for large scale systems. However the plugin would be a good start for someone looking to implement authentication using some other form of auth.
6
+
7
+ **Security** - it is recommended to switch to [auth-encfile][url-authencflat] to protect your user credentials.
8
+
9
+ **IMPORANT NOTE** - this plugin requires that STARTTLS be used via the tls plugin before it will advertise AUTH capabilities by the EHLO command. Localhost and IPs in RFC1918 ranges
10
+ are exempt from this rule.
11
+
12
+ ## Configuration
13
+
14
+ Configuration is stored in `config/auth_flat_file.ini`.
15
+
16
+ - [core]methods
17
+
18
+ Authentication methods are listed in the `[core]methods` parameter. Authentification methods are comma separated. Currently supported methods are: `CRAM-MD5`, `PLAIN` and `LOGIN`. The `PLAIN` and `LOGIN` methods are insecure and require TLS to be enabled.
19
+
20
+ - [core]constrain_sender: (default: true). For outbound messages (due to successful AUTH), constrain the envelope sender (MAIL FROM) to the same domain as the authenticated user. This setting, combined with `rate_rcpt_sender` in the [limit](https://github.com/haraka/haraka-plugin-limit) plugin can dramatically reduce the amount of backscatter and spam sent when an email account is compromised.
21
+
22
+ Example:
23
+
24
+ ```ini
25
+ [core]
26
+ methods=PLAIN,LOGIN,CRAM-MD5
27
+ constrain_sender=true
28
+ ```
29
+
30
+ Users are stored in the `[users]` section.
31
+
32
+ Example:
33
+
34
+ ```ini
35
+ [users]
36
+ user1=password1
37
+ user@domain.com=password2
38
+ ```
39
+
40
+ [url-authencflat]: https://github.com/AuspeXeu/haraka-plugin-auth-enc-file
@@ -0,0 +1,18 @@
1
+ # block_me
2
+
3
+ This plugin allows you to configure an address which mail sent to will be
4
+ parsed for a From: address in the body of the message, and will add that
5
+ from address to the `mail_from.blocklist` config file.
6
+
7
+ Effectively this allows your users to forward spams that got through to a
8
+ particular mailbox to block them in the future.
9
+
10
+ Note that this is a system-wide block, and not per-user. Be careful with this.
11
+
12
+ ## Configuration
13
+
14
+ - `config/block_me.recipient` - a file containing the address to email to
15
+ get something blocked. For example: **spam@domain.com**.
16
+
17
+ - `config/block_me.senders` - a file containing a list of email addresses
18
+ that are allowed to email the dropbox.
@@ -0,0 +1,11 @@
1
+ # data.signatures
2
+
3
+ This plugin allows you to add string signatures to a configuration file and
4
+ have this plugin scan the body text of an email for those strings. Mails
5
+ matching these signatures will be blocked.
6
+
7
+ ## Configuration
8
+
9
+ - data.signatures
10
+
11
+ This file contains a list of strings (one per line) that will be matched.
@@ -0,0 +1,23 @@
1
+ # delay_deny
2
+
3
+ Delays all pre-DATA 'deny' results until the recipients are sent
4
+ and all post-DATA commands until all hook_data_post plugins have run.
5
+ This allows relays and authenticated users to bypass pre-DATA rejections.
6
+
7
+ ## Configuration
8
+
9
+ Configuration options are in config/delay_deny.ini.
10
+
11
+ This plugin operates in one of two modes: included and excluded.
12
+
13
+ ### included plugins
14
+
15
+ A comma or semicolon separated list of denials that are to be included.
16
+ In this mode, _only_ plugins in the list are bypassed. All other plugins
17
+ can immediately reject connections.
18
+
19
+ ### excluded plugins
20
+
21
+ A comma or semicolon separated list of denials that are to be excluded.
22
+ Excluded plugins that are not bypassed and can still immediately reject
23
+ connections.
@@ -0,0 +1,6 @@
1
+ # max_unrecognized_commands
2
+
3
+ The functionality of this plugin was folded into
4
+ [haraka-plugin-limit](https://github.com/haraka/haraka-plugin-limit).
5
+ Loading `max_unrecognized_commands` in `config/plugins` is auto-redirected
6
+ to `limit`.
@@ -0,0 +1,22 @@
1
+ # prevent_credential_leaks
2
+
3
+ This plugin prevents an authenticated user (via SMTP AUTH) from sending
4
+ their username and password out in a message (e.g. like replying to a
5
+ phish).
6
+
7
+ If their username and password are detected inside the message body, then
8
+ the message is rejected with the message:
9
+
10
+ ```
11
+ Credential leak detected: never give out your username/password to anyone!
12
+ ```
13
+
14
+ Note that if the username is qualified e.g. user@domain.com - then the
15
+ plugin will search for both `user` and `user@domain.com` for maximum
16
+ effectiveness.
17
+
18
+ ## Configuration
19
+
20
+ No configuration is required. Simply add the plugin to your `config/plugins`
21
+ file. It should be added before any other plugins that run on hook_data_post
22
+ for maximum efficiency.
@@ -0,0 +1,42 @@
1
+ # process_title
2
+
3
+ This plugin causes the process title seen by the UNIX 'ps' command to
4
+ be modified from this:
5
+
6
+ ```
7
+ node haraka.js -c /etc/haraka
8
+ ```
9
+
10
+ to this:
11
+
12
+ ```
13
+ Haraka (master) cn=11148 cc=1082 cps=21/25.24/79 rcpts=144950/1.84 rps=518/328.18/586 msgs=78815/7.07 mps=302/178.44/329 out=0/0/0 respawn=0
14
+ \_ Haraka (worker) cn=1646 cc=140 cps=5/3.73/17 rcpts=20310/1.86 rps=75/46.04/102 msgs=10938/6.65 mps=42/24.8/56 out=0/0/0
15
+ \_ Haraka (worker) cn=1563 cc=168 cps=3/3.54/18 rcpts=19844/1.87 rps=78/45/96 msgs=10627/6.8 mps=49/24.1/53 out=0/0/0
16
+ \_ Haraka (worker) cn=1852 cc=172 cps=3/4.2/16 rcpts=26278/2.03 rps=93/59.56/114 msgs=12938/6.99 mps=40/29.33/65 out=0/0/0
17
+ \_ Haraka (worker) cn=1704 cc=187 cps=5/3.86/14 rcpts=23688/1.84 rps=93/53.7/125 msgs=12886/7.56 mps=64/29.21/66 out=0/0/0
18
+ \_ Haraka (worker) cn=2296 cc=218 cps=2/5.2/20 rcpts=29300/1.78 rps=117/66.4/125 msgs=16489/7.18 mps=40/37.37/66 out=0/0/0
19
+ \_ Haraka (worker) cn=2091 cc=195 cps=4/4.74/16 rcpts=25646/1.71 rps=84/58.12/117 msgs=14982/7.16 mps=52/33.95/66 out=0/0/0
20
+ ```
21
+
22
+ where:
23
+
24
+ - cn = Total number of connections
25
+ - cc = Total number of concurrent connections
26
+ - cps = Number of connections in the last second / average / maximum
27
+ - rcpts = Total number of recipients / Average number of recipients per message
28
+ - rps = Number of recipients in the last second / average / maximum
29
+ - msgs = Total number of messages / Average number messages per connection
30
+ - mps = Number of messages in the last second / average / maximum
31
+ - out = Mails being processed / Mails waiting to be processed / Mails in temp fail state
32
+ - respawn = Number of worker processes respawned (only under cluster)
33
+
34
+ If 'cluster' is used then the master process will show the total
35
+ across all workers, with the exception of outbound stats.
36
+
37
+ All of the counts shown are since the process started, so if a
38
+ worker has been re-started then the counts may not add up.
39
+
40
+ Note: this plugin should be added at the top of `config/plugins` so
41
+ that its `connect_init`, `rcpt`, `data`, and `disconnect` hooks run
42
+ before any plugin that might short-circuit those hooks.
@@ -0,0 +1,3 @@
1
+ # queue/deliver
2
+
3
+ This plugin is now redundant. Outbound delivery is now built into Haraka.
@@ -0,0 +1,32 @@
1
+ # discard
2
+
3
+ This plugin will discard a message by pretending that the message was queued.
4
+
5
+ It is designed to be used by other plugins which request the message be
6
+ discard by setting a connection or transaction note that this plugin
7
+ checks.
8
+
9
+ It uses the 'queue' hook, so it runs after all the plugins that hook on `data_post`.
10
+
11
+ If you use the 'quarantine' plug-in then this plugin should run _after_ it.
12
+
13
+ USE THIS PLUGIN WITH CARE!
14
+
15
+ # Enable
16
+
17
+ Enable by adding a `queue/discard` entry in `config/plugins` **before** your
18
+ other queue plugins that perform actual deliveries.
19
+
20
+ # Usage
21
+
22
+ Set
23
+
24
+ ```javascript
25
+ connection.notes.discard = [1 | true]
26
+ ```
27
+
28
+ or
29
+
30
+ ```javascript
31
+ connection.transaction.notes.discard = [1 | true]
32
+ ```
@@ -0,0 +1,24 @@
1
+ # queue/lmtp
2
+
3
+ This plugin delivers inbound mail via LMTP.
4
+
5
+ ## Configuration
6
+
7
+ LMTP is enabled by adding `queue/lmtp` to config/plugins. LMTP delivery is configured in `config/lmtp.ini` . By default, all inbound messages are forwarded to the host specified in the `[main]` section. Domain specific routes can be specified by creating additional sections with the same host/port or path options.
8
+
9
+ ### lmtp.ini
10
+
11
+ ```ini
12
+ ; defaults
13
+ host=localhost
14
+ port=24
15
+
16
+ [example1.com]
17
+ ; Goes elsewhere
18
+ host=10.1.1.1
19
+ port=2400
20
+
21
+ [example2.com]
22
+ ; Using unix domain sockets
23
+ path = /tmp/blah_com_socket
24
+ ```
@@ -0,0 +1,16 @@
1
+ # queue/qmail-queue
2
+
3
+ This plugin delivers the mail to the `qmail-queue` program, which can be used
4
+ for both inbound and outbound delivery.
5
+
6
+ ## Configuration
7
+
8
+ - qmail-queue.path
9
+
10
+ The path to the `qmail-queue` binary. Default: `/var/qmail/bin/qmail-queue`
11
+
12
+ - qmail-queue.ini
13
+ - enable_outbound=true
14
+
15
+ Deliver outbound email to qmail. Set to false to use Haraka's
16
+ separate Outbound mail routing (MX based delivery)).
@@ -0,0 +1,87 @@
1
+ # quarantine
2
+
3
+ This plugin will save a message (in message/rfc822 format) to a specified
4
+ directory, which will be created automatically if it does not already exist,
5
+ a dated sub-folder is also added to the end of the path specified in YYYYMMDD
6
+ format.
7
+
8
+ It is designed to be used by other plugins which request the message be
9
+ quarantined by setting a connection or transaction note that this plugin
10
+ checks.
11
+
12
+ NOTE: this plugin simply saves a copy of the message. It does not reject or
13
+ discard the message and relies on another plugin to perform this function.
14
+
15
+ It uses the 'queue' hook, so that it runs after all the 'data_post' plugins
16
+ and should be listed in 'config/plugins' to run before your queue hooks that
17
+ perform actual deliveries.
18
+
19
+ To ensure that only completely written files are present in the quarantine,
20
+ the files are written to a temporary directory first and then hardlinked to
21
+ the final destination before the temporary file is deleted.
22
+
23
+ The temporary directory is 'quarantine_path/tmp' which defaults to:
24
+ /var/spool/haraka/quarantine/tmp.
25
+
26
+ Upon start-up, any files present in the temporary directory are deleted
27
+ syncronously prior to any messages being accepted.
28
+
29
+ ## Configuration
30
+
31
+ This plugin looks for 'quarantine.ini' in the config directory.
32
+
33
+ - quarantine_path (default: /var/spool/haraka/quarantine)
34
+
35
+ The default base path to save the quarantine files to. It will be created
36
+ if it does not already exist.
37
+
38
+ ## Usage
39
+
40
+ If you wish to keep a copy of the message in your plugin, simply either:
41
+
42
+ ```javascript
43
+ connection.notes.quarantine = [1 | true | 'sub/directory/path']
44
+ ```
45
+
46
+ or
47
+
48
+ ```javascript
49
+ connection.transaction.notes.quarantine = [1 | true | 'sub/directory/path']
50
+ ```
51
+
52
+ e.g.
53
+
54
+ ```javascript
55
+ connection.notes.quarantine = 1
56
+ ```
57
+
58
+ would save the message to '/var/spool/quarantine/haraka/YYYYMMDD/UUID' where
59
+ YYYMMDD and UUID are expanded to current date and transaction UUID.
60
+
61
+ and
62
+
63
+ ```javascript
64
+ connection.notes.quarantine = 'corpus'
65
+ ```
66
+
67
+ would save the message to '/var/spool/quarantine/haraka/corpus/YYYYMMDD/UUID'.
68
+
69
+ Note: you can specify 'corpus/foo' or 'corpus/foo/bar' and the directories will
70
+ be automatically created. Do not add any leading or trailing slashes.
71
+
72
+ By default - after the message is quarantined, the plugin will tell Haraka to
73
+ continue to the next plugin. You can specify a different action like DENY or
74
+ OK and supply an optional message using the following notes:
75
+
76
+ ```javascript
77
+ connection.notes.quarantine_action = [OK, 'Message quarantined']
78
+ connection.transaction.notes.quarantine_action = [DENY, 'Message rejected']
79
+ ```
80
+
81
+ If you don't want to supply a specific message back to the client you can
82
+ also just specify a return code:
83
+
84
+ ```javascript
85
+ connection.notes.quarantine_action = OK
86
+ connection.transaction.notes.quarantine_action = DENY
87
+ ```
@@ -0,0 +1,32 @@
1
+ # queue/smtp_bridge
2
+
3
+ This plugin delivers to another SMTP server, bridging the authentication
4
+ details and post data from the initial connection.
5
+
6
+ This plugin is meant to be used with the plugin `auth/auth_bridge`.
7
+
8
+ It is different than `queue/smtp_proxy` or `queue/smpt_forward` because
9
+ it doesn't use the AUTH details from a configuration file. This plugins
10
+ simply post the data from the original connection to the remote SMTP server
11
+ using the original AUTH details.
12
+
13
+ ## Configuration
14
+
15
+ Configuration is stored in `config/smtp_bridge.ini` and uses the INI
16
+ style formatting.
17
+
18
+ The configuration of this plugin is simple:
19
+
20
+ host=localhost
21
+ #port=
22
+ #auth_type=
23
+ #priority=10
24
+
25
+ - host: the host where you will be authenticating and posting,
26
+ for example `smtp.host.tld`. This is the only setting required.
27
+
28
+ If needed you can also set
29
+
30
+ - port: default to empty and Haraka will use 25.
31
+ - auth_type: default to empty and Haraka will try to pick an appropriate method.
32
+ - priority: default to 10.