Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v1.0.3 #4

Merged
merged 5 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release
Submodule .release updated 1 files
+7 −1 start.sh
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).

### Unreleased

### [1.0.3] - 2025-02-06

- results: tidying up duplicate data
- results.hits: deleted, alias for score
- results.status: deleted, alias for flag
- results.flag: change from Yes/No to boolean

### [1.0.2] - 2025-01-26

- prettier: move config into package.json
Expand All @@ -16,6 +23,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).

- repackaged from haraka/Haraka

[1.0.1]: https://github.com/haraka/haraka-plugin-spamassassin/releases/tag/v1.0.1
[1.0.1]: https://github.com/haraka/haraka-plugin-spamassassin/releases/tag/1.0.1
[1.0.2]: https://github.com/haraka/haraka-plugin-spamassassin/releases/tag/v1.0.2
[1.0.0]: https://github.com/haraka/haraka-plugin-spamassassin/releases/tag/1.0.0
[1.0.3]: https://github.com/haraka/haraka-plugin-spamassassin/releases/tag/v1.0.3
2 changes: 1 addition & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This handcrafted artisinal software is brought to you by:

| <img height="80" src="https://avatars.githubusercontent.com/u/261635?v=4"><br><a href="https://github.com/msimerson">msimerson</a> (<a href="https://github.com/haraka/haraka-plugin-spamassassin/commits?author=msimerson">3</a>) |
| <img height="80" src="https://avatars.githubusercontent.com/u/261635?v=4"><br><a href="https://github.com/msimerson">msimerson</a> (<a href="https://github.com/haraka/haraka-plugin-spamassassin/commits?author=msimerson">4</a>) |
| :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |

<sub>this file is generated by [.release](https://github.com/msimerson/.release).
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ Other headers options you might find interesting or useful are:
add_header all DCC _DCCB_: _DCCR_
add_header all Tests _TESTS_

## USAGE

<!-- leave these buried at the bottom of the document -->

Expand Down
10 changes: 3 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,9 @@ exports.hook_data_post = function (next, connection) {
/Spam: (True|False) ; (-?\d+\.\d) \/ (-?\d+\.\d)/,
)
if (matches) {
spamd_response.flag = matches[1]
spamd_response.flag = matches[1] === 'True'
spamd_response.score = matches[2]
spamd_response.hits = matches[2] // backwards compat
spamd_response.reqd = matches[3]
spamd_response.flag = spamd_response.flag === 'True' ? 'Yes' : 'No'
}
} else {
state = 'headers'
Expand Down Expand Up @@ -131,7 +129,6 @@ exports.hook_data_post = function (next, connection) {
txn.notes.spamassassin = spamd_response
connection.results.add(this, {
time: (Date.now() - start) / 1000,
hits: spamd_response.hits,
flag: spamd_response.flag,
})

Expand Down Expand Up @@ -197,7 +194,7 @@ exports.munge_subject = function (conn, score) {
}

exports.do_header_updates = function (conn, spamd_response) {
if (spamd_response.flag === 'Yes') {
if (spamd_response.flag) {
// X-Spam-Flag is added by SpamAssassin
conn.transaction.remove_header('precedence')
conn.transaction.add_header('Precedence', 'junk')
Expand Down Expand Up @@ -342,15 +339,14 @@ exports.log_results = function (conn, spamd_response) {
: cfg.reject_threshold

const human_text =
`status=${spamd_response.flag}` +
`status=${spamd_response.flag ? 'Yes' : 'No'}` +
`, score=${spamd_response.score}` +
`, required=${spamd_response.reqd}` +
`, reject=${reject_threshold}` +
`, tests="${spamd_response.tests}"`

conn.transaction.results.add(this, {
human: human_text,
status: spamd_response.flag,
score: parseFloat(spamd_response.score),
required: parseFloat(spamd_response.reqd),
reject: reject_threshold,
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "haraka-plugin-spamassassin",
"version": "1.0.2",
"version": "1.0.3",
"description": "Haraka plugin that scans messages with SpamAssassin",
"main": "index.js",
"files": [
Expand Down Expand Up @@ -33,13 +33,13 @@
},
"homepage": "https://github.com/haraka/haraka-plugin-spamassassin#readme",
"dependencies": {
"haraka-net-utils": "^1.7.1",
"haraka-utils": "^1.1.3"
"haraka-net-utils": "^1.7.2",
"haraka-utils": "^1.1.4"
},
"devDependencies": {
"@haraka/eslint-config": "^2.0.2",
"address-rfc2821": "^2.1.2",
"haraka-test-fixtures": "1.3.8"
"address-rfc2821": "^2.1.3",
"haraka-test-fixtures": "1.3.9"
},
"prettier": {
"singleQuote": true,
Expand Down