haraka-plugin-spamassassin 1.0.2 → 1.0.3

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/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
4
4
 
5
5
  ### Unreleased
6
6
 
7
+ ### [1.0.3] - 2025-02-06
8
+
9
+ - results: tidying up duplicate data
10
+ - results.hits: deleted, alias for score
11
+ - results.status: deleted, alias for flag
12
+ - results.flag: change from Yes/No to boolean
13
+
7
14
  ### [1.0.2] - 2025-01-26
8
15
 
9
16
  - prettier: move config into package.json
@@ -16,6 +23,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
16
23
 
17
24
  - repackaged from haraka/Haraka
18
25
 
19
- [1.0.1]: https://github.com/haraka/haraka-plugin-spamassassin/releases/tag/v1.0.1
26
+ [1.0.1]: https://github.com/haraka/haraka-plugin-spamassassin/releases/tag/1.0.1
20
27
  [1.0.2]: https://github.com/haraka/haraka-plugin-spamassassin/releases/tag/v1.0.2
21
28
  [1.0.0]: https://github.com/haraka/haraka-plugin-spamassassin/releases/tag/1.0.0
29
+ [1.0.3]: https://github.com/haraka/haraka-plugin-spamassassin/releases/tag/v1.0.3
package/README.md CHANGED
@@ -178,7 +178,6 @@ Other headers options you might find interesting or useful are:
178
178
  add_header all DCC _DCCB_: _DCCR_
179
179
  add_header all Tests _TESTS_
180
180
 
181
- ## USAGE
182
181
 
183
182
  <!-- leave these buried at the bottom of the document -->
184
183
 
package/index.js CHANGED
@@ -82,11 +82,9 @@ exports.hook_data_post = function (next, connection) {
82
82
  /Spam: (True|False) ; (-?\d+\.\d) \/ (-?\d+\.\d)/,
83
83
  )
84
84
  if (matches) {
85
- spamd_response.flag = matches[1]
85
+ spamd_response.flag = matches[1] === 'True'
86
86
  spamd_response.score = matches[2]
87
- spamd_response.hits = matches[2] // backwards compat
88
87
  spamd_response.reqd = matches[3]
89
- spamd_response.flag = spamd_response.flag === 'True' ? 'Yes' : 'No'
90
88
  }
91
89
  } else {
92
90
  state = 'headers'
@@ -131,7 +129,6 @@ exports.hook_data_post = function (next, connection) {
131
129
  txn.notes.spamassassin = spamd_response
132
130
  connection.results.add(this, {
133
131
  time: (Date.now() - start) / 1000,
134
- hits: spamd_response.hits,
135
132
  flag: spamd_response.flag,
136
133
  })
137
134
 
@@ -197,7 +194,7 @@ exports.munge_subject = function (conn, score) {
197
194
  }
198
195
 
199
196
  exports.do_header_updates = function (conn, spamd_response) {
200
- if (spamd_response.flag === 'Yes') {
197
+ if (spamd_response.flag) {
201
198
  // X-Spam-Flag is added by SpamAssassin
202
199
  conn.transaction.remove_header('precedence')
203
200
  conn.transaction.add_header('Precedence', 'junk')
@@ -342,7 +339,7 @@ exports.log_results = function (conn, spamd_response) {
342
339
  : cfg.reject_threshold
343
340
 
344
341
  const human_text =
345
- `status=${spamd_response.flag}` +
342
+ `status=${spamd_response.flag ? 'Yes' : 'No'}` +
346
343
  `, score=${spamd_response.score}` +
347
344
  `, required=${spamd_response.reqd}` +
348
345
  `, reject=${reject_threshold}` +
@@ -350,7 +347,6 @@ exports.log_results = function (conn, spamd_response) {
350
347
 
351
348
  conn.transaction.results.add(this, {
352
349
  human: human_text,
353
- status: spamd_response.flag,
354
350
  score: parseFloat(spamd_response.score),
355
351
  required: parseFloat(spamd_response.reqd),
356
352
  reject: reject_threshold,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "haraka-plugin-spamassassin",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Haraka plugin that scans messages with SpamAssassin",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -33,13 +33,13 @@
33
33
  },
34
34
  "homepage": "https://github.com/haraka/haraka-plugin-spamassassin#readme",
35
35
  "dependencies": {
36
- "haraka-net-utils": "^1.7.1",
37
- "haraka-utils": "^1.1.3"
36
+ "haraka-net-utils": "^1.7.2",
37
+ "haraka-utils": "^1.1.4"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@haraka/eslint-config": "^2.0.2",
41
- "address-rfc2821": "^2.1.2",
42
- "haraka-test-fixtures": "1.3.8"
41
+ "address-rfc2821": "^2.1.3",
42
+ "haraka-test-fixtures": "1.3.9"
43
43
  },
44
44
  "prettier": {
45
45
  "singleQuote": true,