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/tests/spf.js DELETED
@@ -1,96 +0,0 @@
1
- const SPF = require('../spf').SPF;
2
- SPF.prototype.log_debug = () => {}; // noop, hush debug output
3
-
4
- function _set_up (done) {
5
- this.SPF = new SPF();
6
- done();
7
- }
8
-
9
- exports.SPF = {
10
- setUp : _set_up,
11
- 'new SPF' (test) {
12
- test.expect(1);
13
- test.ok(this.SPF);
14
- test.done();
15
- },
16
- 'constants' (test) {
17
- test.expect(8);
18
- test.equal(1, this.SPF.SPF_NONE);
19
- test.equal(2, this.SPF.SPF_PASS);
20
- test.equal(3, this.SPF.SPF_FAIL);
21
- test.equal(4, this.SPF.SPF_SOFTFAIL);
22
- test.equal(5, this.SPF.SPF_NEUTRAL);
23
- test.equal(6, this.SPF.SPF_TEMPERROR);
24
- test.equal(7, this.SPF.SPF_PERMERROR);
25
- test.equal(10, this.SPF.LIMIT);
26
- test.done();
27
- },
28
- 'mod_redirect, true' (test) {
29
- test.expect(2);
30
- this.SPF.been_there['example.com'] = true;
31
- this.SPF.mod_redirect('example.com', (err, rc) => {
32
- test.equal(null, err);
33
- test.equal(1, rc);
34
- test.done();
35
- });
36
- },
37
- 'mod_redirect, false' (test) {
38
- test.expect(2);
39
- this.SPF.count=0;
40
- this.SPF.ip='212.70.129.94';
41
- this.SPF.mail_from='fraud@aexp.com';
42
- this.SPF.mod_redirect('aexp.com', (err, rc) => {
43
- test.equal(null, err);
44
- switch (rc) {
45
- case 7:
46
- // from time to time (this is the third time we've seen it,
47
- // American Express publishes an invalid SPF record which results
48
- // in a PERMERROR. Ignore it.
49
- test.equal(rc, 7, "aexp SPF record is broken again");
50
- break;
51
- case 6:
52
- test.equal(rc, 6, "temporary (likely DNS timeout) error");
53
- break;
54
- default:
55
- test.equal(rc, 3);
56
- }
57
- test.done();
58
- });
59
- },
60
- 'check_host, gmail.com, fail' (test) {
61
- test.expect(2);
62
- this.SPF.count=0;
63
- this.SPF.check_host('212.70.129.94', 'gmail.com', 'haraka.mail@gmail.com', (err, rc) => {
64
- test.equal(null, err);
65
- switch (rc) {
66
- case 1:
67
- test.equal(rc, 1, "none");
68
- console.log('Why do DNS lookup fail to find gmail SPF record on GitHub Actions?');
69
- break;
70
- case 3:
71
- test.equal(rc, 3, "fail");
72
- break;
73
- case 4:
74
- test.equal(rc, 4, "soft fail");
75
- break;
76
- case 7:
77
- test.equal(rc, 7, "perm error");
78
- break;
79
- default:
80
- test.equal(rc, 4)
81
- }
82
- test.done();
83
- });
84
- },
85
- 'valid_ip, true' (test) {
86
- test.expect(1);
87
- test.equal(this.SPF.valid_ip(':212.70.129.94'), true);
88
- test.done();
89
- },
90
- 'valid_ip, false' (test) {
91
- test.expect(1);
92
- test.equal(this.SPF.valid_ip(':212.70.d.94'), false);
93
- test.done();
94
- }
95
-
96
- }