Haraka 3.1.0 → 3.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/.prettierignore +4 -0
  2. package/CONTRIBUTORS.md +5 -5
  3. package/Changes.md +69 -50
  4. package/Plugins.md +3 -1
  5. package/README.md +1 -1
  6. package/bin/haraka +475 -478
  7. package/config/outbound.ini +3 -0
  8. package/connection.js +1072 -1108
  9. package/docs/Connection.md +29 -30
  10. package/docs/CoreConfig.md +38 -39
  11. package/docs/CustomReturnCodes.md +0 -1
  12. package/docs/HAProxy.md +2 -2
  13. package/docs/Header.md +1 -1
  14. package/docs/Logging.md +29 -5
  15. package/docs/Outbound.md +93 -78
  16. package/docs/Plugins.md +103 -108
  17. package/docs/Transaction.md +49 -51
  18. package/docs/Tutorial.md +127 -143
  19. package/docs/deprecated/access.md +0 -1
  20. package/docs/deprecated/backscatterer.md +2 -3
  21. package/docs/deprecated/connect.rdns_access.md +18 -27
  22. package/docs/deprecated/data.headers.md +0 -1
  23. package/docs/deprecated/data.nomsgid.md +1 -2
  24. package/docs/deprecated/data.noreceived.md +1 -2
  25. package/docs/deprecated/data.rfc5322_header_checks.md +1 -2
  26. package/docs/deprecated/dkim_sign.md +13 -17
  27. package/docs/deprecated/dkim_verify.md +9 -17
  28. package/docs/deprecated/dnsbl.md +36 -38
  29. package/docs/deprecated/dnswl.md +41 -43
  30. package/docs/deprecated/lookup_rdns.strict.md +21 -34
  31. package/docs/deprecated/mail_from.access.md +17 -25
  32. package/docs/deprecated/mail_from.blocklist.md +9 -12
  33. package/docs/deprecated/mail_from.nobounces.md +1 -2
  34. package/docs/deprecated/rcpt_to.access.md +20 -27
  35. package/docs/deprecated/rcpt_to.blocklist.md +10 -13
  36. package/docs/deprecated/rcpt_to.routes.md +0 -1
  37. package/docs/deprecated/rdns.regexp.md +13 -15
  38. package/docs/plugins/aliases.md +89 -89
  39. package/docs/plugins/auth/auth_bridge.md +5 -7
  40. package/docs/plugins/auth/auth_ldap.md +11 -14
  41. package/docs/plugins/auth/auth_proxy.md +10 -12
  42. package/docs/plugins/auth/auth_vpopmaild.md +5 -6
  43. package/docs/plugins/auth/flat_file.md +4 -4
  44. package/docs/plugins/block_me.md +3 -3
  45. package/docs/plugins/data.signatures.md +1 -2
  46. package/docs/plugins/delay_deny.md +3 -4
  47. package/docs/plugins/max_unrecognized_commands.md +4 -4
  48. package/docs/plugins/prevent_credential_leaks.md +6 -6
  49. package/docs/plugins/process_title.md +18 -18
  50. package/docs/plugins/queue/deliver.md +2 -3
  51. package/docs/plugins/queue/discard.md +4 -4
  52. package/docs/plugins/queue/lmtp.md +1 -3
  53. package/docs/plugins/queue/qmail-queue.md +7 -9
  54. package/docs/plugins/queue/quarantine.md +16 -21
  55. package/docs/plugins/queue/rabbitmq.md +8 -11
  56. package/docs/plugins/queue/rabbitmq_amqplib.md +43 -39
  57. package/docs/plugins/queue/smtp_bridge.md +7 -10
  58. package/docs/plugins/queue/smtp_forward.md +42 -34
  59. package/docs/plugins/queue/smtp_proxy.md +30 -29
  60. package/docs/plugins/queue/test.md +1 -3
  61. package/docs/plugins/rcpt_to.in_host_list.md +6 -6
  62. package/docs/plugins/rcpt_to.max_count.md +1 -1
  63. package/docs/plugins/record_envelope_addresses.md +3 -3
  64. package/docs/plugins/reseed_rng.md +6 -6
  65. package/docs/plugins/status.md +9 -8
  66. package/docs/plugins/tarpit.md +7 -11
  67. package/docs/plugins/tls.md +12 -17
  68. package/docs/plugins/toobusy.md +4 -4
  69. package/docs/plugins/xclient.md +3 -3
  70. package/docs/tutorials/Migrating_from_v1_to_v2.md +19 -41
  71. package/docs/tutorials/SettingUpOutbound.md +6 -9
  72. package/endpoint.js +35 -38
  73. package/eslint.config.mjs +22 -19
  74. package/haraka.js +42 -47
  75. package/host_pool.js +75 -79
  76. package/http/html/404.html +45 -49
  77. package/http/html/index.html +39 -28
  78. package/http/package.json +2 -4
  79. package/line_socket.js +27 -28
  80. package/logger.js +182 -201
  81. package/outbound/client_pool.js +34 -27
  82. package/outbound/config.js +64 -59
  83. package/outbound/fsync_writestream.js +24 -25
  84. package/outbound/hmail.js +888 -835
  85. package/outbound/index.js +194 -187
  86. package/outbound/qfile.js +49 -52
  87. package/outbound/queue.js +197 -190
  88. package/outbound/timer_queue.js +41 -43
  89. package/outbound/tls.js +68 -61
  90. package/outbound/todo.js +11 -11
  91. package/package.json +38 -33
  92. package/plugins/.eslintrc.yaml +0 -1
  93. package/plugins/auth/auth_base.js +123 -127
  94. package/plugins/auth/auth_bridge.js +7 -7
  95. package/plugins/auth/auth_proxy.js +121 -126
  96. package/plugins/auth/auth_vpopmaild.js +84 -85
  97. package/plugins/auth/flat_file.js +18 -17
  98. package/plugins/block_me.js +31 -31
  99. package/plugins/data.signatures.js +13 -13
  100. package/plugins/delay_deny.js +65 -61
  101. package/plugins/prevent_credential_leaks.js +23 -23
  102. package/plugins/process_title.js +125 -128
  103. package/plugins/profile.js +5 -5
  104. package/plugins/queue/deliver.js +3 -3
  105. package/plugins/queue/discard.js +13 -14
  106. package/plugins/queue/lmtp.js +16 -17
  107. package/plugins/queue/qmail-queue.js +54 -55
  108. package/plugins/queue/quarantine.js +68 -70
  109. package/plugins/queue/rabbitmq.js +80 -87
  110. package/plugins/queue/rabbitmq_amqplib.js +75 -54
  111. package/plugins/queue/smtp_bridge.js +16 -16
  112. package/plugins/queue/smtp_forward.js +175 -179
  113. package/plugins/queue/smtp_proxy.js +69 -71
  114. package/plugins/queue/test.js +9 -9
  115. package/plugins/rcpt_to.host_list_base.js +30 -34
  116. package/plugins/rcpt_to.in_host_list.js +19 -19
  117. package/plugins/record_envelope_addresses.js +4 -4
  118. package/plugins/reseed_rng.js +4 -4
  119. package/plugins/status.js +90 -97
  120. package/plugins/tarpit.js +25 -14
  121. package/plugins/tls.js +68 -68
  122. package/plugins/toobusy.js +21 -23
  123. package/plugins/xclient.js +51 -53
  124. package/plugins.js +276 -293
  125. package/rfc1869.js +30 -35
  126. package/server.js +308 -299
  127. package/smtp_client.js +244 -228
  128. package/test/.eslintrc.yaml +0 -1
  129. package/test/connection.js +127 -134
  130. package/test/endpoint.js +53 -47
  131. package/test/fixtures/line_socket.js +12 -12
  132. package/test/fixtures/util_hmailitem.js +89 -85
  133. package/test/host_pool.js +90 -92
  134. package/test/installation/plugins/base_plugin.js +2 -2
  135. package/test/installation/plugins/folder_plugin/index.js +2 -3
  136. package/test/installation/plugins/inherits.js +3 -3
  137. package/test/installation/plugins/load_first.js +2 -3
  138. package/test/installation/plugins/plugin.js +1 -3
  139. package/test/installation/plugins/tls.js +2 -4
  140. package/test/logger.js +135 -116
  141. package/test/outbound/hmail.js +49 -35
  142. package/test/outbound/index.js +118 -101
  143. package/test/outbound/qfile.js +51 -53
  144. package/test/outbound_bounce_net_errors.js +84 -69
  145. package/test/outbound_bounce_rfc3464.js +235 -165
  146. package/test/plugins/auth/auth_base.js +420 -279
  147. package/test/plugins/auth/auth_vpopmaild.js +38 -39
  148. package/test/plugins/queue/smtp_forward.js +126 -104
  149. package/test/plugins/rcpt_to.host_list_base.js +85 -67
  150. package/test/plugins/rcpt_to.in_host_list.js +159 -112
  151. package/test/plugins/status.js +71 -64
  152. package/test/plugins/tls.js +37 -34
  153. package/test/plugins.js +97 -92
  154. package/test/rfc1869.js +19 -26
  155. package/test/server.js +293 -272
  156. package/test/smtp_client.js +180 -176
  157. package/test/tls_socket.js +62 -66
  158. package/test/transaction.js +159 -160
  159. package/tls_socket.js +331 -333
  160. package/transaction.js +129 -137
package/rfc1869.js CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';
1
+ 'use strict'
2
2
  // RFC 1869 command parser
3
3
 
4
4
  // 6. MAIL FROM and RCPT TO Parameters
@@ -20,28 +20,27 @@
20
20
  // ("RCPT TO:" forward-path)
21
21
 
22
22
  /* eslint no-control-regex: 0 */
23
- const chew_regexp = /\s+([A-Za-z0-9][A-Za-z0-9-]*(?:=[^= \x00-\x1f]+)?)$/;
23
+ const chew_regexp = /\s+([A-Za-z0-9][A-Za-z0-9-]*(?:=[^= \x00-\x1f]+)?)$/
24
24
 
25
25
  exports.parse = (type, line, strict) => {
26
- let params = [];
27
- line = (new String(line)).replace(/\s*$/, '');
26
+ let params = []
27
+ line = new String(line).replace(/\s*$/, '')
28
28
  if (type === 'mail') {
29
- line = line.replace(strict ? /from:/i : /from:\s*/i, '');
30
- }
31
- else {
32
- line = line.replace(strict ? /to:/i : /to:\s*/i, '');
29
+ line = line.replace(strict ? /from:/i : /from:\s*/i, '')
30
+ } else {
31
+ line = line.replace(strict ? /to:/i : /to:\s*/i, '')
33
32
  }
34
33
 
35
34
  while (1) {
36
- const old_length = line.length;
37
- line = line.replace(chew_regexp, function repl (str, p1) {
38
- params.push(p1);
39
- return '';
40
- });
41
- if (old_length === line.length) break;
35
+ const old_length = line.length
36
+ line = line.replace(chew_regexp, function repl(str, p1) {
37
+ params.push(p1)
38
+ return ''
39
+ })
40
+ if (old_length === line.length) break
42
41
  }
43
42
 
44
- params = params.reverse();
43
+ params = params.reverse()
45
44
 
46
45
  // the above will "fail" (i.e. all of the line in params) on
47
46
  // some addresses without <> like
@@ -53,46 +52,42 @@ exports.parse = (type, line, strict) => {
53
52
  // parameter syntax error, i.e. not all of the arguments were
54
53
  // stripped by the while() loop:
55
54
  if (line.match(/@.*\s/)) {
56
- throw new Error(`Syntax error in parameters ("${line}")`);
55
+ throw new Error(`Syntax error in parameters ("${line}")`)
57
56
  }
58
57
 
59
- params.unshift(line);
58
+ params.unshift(line)
60
59
  }
61
60
 
62
- line = params.shift() || '';
61
+ line = params.shift() || ''
63
62
  if (strict) {
64
63
  if (!line.match(/^<.*>$/)) {
65
- throw new Error(`Invalid format of ${type} command: ${line}`);
64
+ throw new Error(`Invalid format of ${type} command: ${line}`)
66
65
  }
67
66
  }
68
67
 
69
68
  if (type === 'mail') {
70
69
  if (!line.length) {
71
- return ["<>"]; // 'MAIL FROM:' --> 'MAIL FROM:<>'
70
+ return ['<>'] // 'MAIL FROM:' --> 'MAIL FROM:<>'
72
71
  }
73
72
  if (line.match(/@.*\s/)) {
74
- throw new Error('Syntax error in parameters');
73
+ throw new Error('Syntax error in parameters')
75
74
  }
76
- }
77
- else {
75
+ } else {
78
76
  // console.log(`Looking at ${line}``);
79
77
  if (line.match(/@.*\s/)) {
80
- throw new Error('Syntax error in parameters');
81
- }
82
- else {
78
+ throw new Error('Syntax error in parameters')
79
+ } else {
83
80
  if (line.match(/\s/)) {
84
- throw new Error('Syntax error in parameters');
85
- }
86
- else if (line.match(/@/)) {
87
- if (!line.match(/^<.*>$/)) line = `<${line}>`;
88
- }
89
- else if (!line.match(/^<(postmaster|abuse)>$/i)) {
90
- throw new Error(`Syntax error in address: ${line}`);
81
+ throw new Error('Syntax error in parameters')
82
+ } else if (line.match(/@/)) {
83
+ if (!line.match(/^<.*>$/)) line = `<${line}>`
84
+ } else if (!line.match(/^<(postmaster|abuse)>$/i)) {
85
+ throw new Error(`Syntax error in address: ${line}`)
91
86
  }
92
87
  }
93
88
  }
94
89
 
95
- params.unshift(line);
90
+ params.unshift(line)
96
91
 
97
- return params;
92
+ return params
98
93
  }