Skip to content

Commit

Permalink
Release v1.0.3 (#2)
Browse files Browse the repository at this point in the history
- config: add verify.enabled setting
- doc(CONTRIBUTORS): added
  • Loading branch information
msimerson authored Apr 16, 2024
1 parent ed49547 commit 405a975
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .release
Submodule .release updated 1 files
+2 −3 contributors.js
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).

### Unreleased

### [1.0.3] - 2024-04-15

- config: add `verify.enabled` setting

### [1.0.2] - 2024-04-10

- fix: properly scope the logdebug injections
Expand All @@ -14,3 +18,4 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).

[1.0.0]: https://github.com/haraka/haraka-plugin-dkim/releases/tag/v1.0.0
[1.0.2]: https://github.com/haraka/haraka-plugin-dkim/releases/tag/v1.0.2
[1.0.3]: https://github.com/haraka/haraka-plugin-dkim/releases/tag/v1.0.3
8 changes: 8 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Contributors

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-dkim/commits?author=msimerson">3</a>) |
| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |

<sub>this file is maintained by [.release](https://github.com/msimerson/.release)</sub>
2 changes: 2 additions & 0 deletions config/dkim.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ headers = From, Sender, Reply-To, Subject, Date, Message-ID, To, Cc, MIME-Versio


[verify]
enabled = true

; Recommended (but not default) values presented below.

; in secs
Expand Down
13 changes: 10 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,20 @@ exports.register = function () {
plugin.logdebug(str)
}

this.register_hook('data_post', 'dkim_verify')
this.register_hook('queue_outbound', 'hook_pre_send_trans_email')
if (this.cfg.verify.enabled) {
this.register_hook('data_post', 'dkim_verify')
}

if (this.cfg.sign.enabled) {
this.register_hook('queue_outbound', 'hook_pre_send_trans_email')
}
}

exports.load_dkim_ini = function () {
this.cfg = this.config.get(
'dkim.ini',
{
booleans: ['-sign.enabled'],
booleans: ['-sign.enabled', '+verify.enabled'],
},
() => {
this.load_dkim_ini()
Expand Down Expand Up @@ -304,6 +309,8 @@ exports.get_sender_domain = function (connection) {
}

exports.dkim_verify = function (next, connection) {
if (!this.cfg.verify.enabled) return next()

const txn = connection?.transaction
if (!txn) return next()

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "haraka-plugin-dkim",
"version": "1.0.2",
"version": "1.0.3",
"description": "Haraka DKIM plugin",
"main": "index.js",
"files": [
Expand All @@ -16,8 +16,8 @@
"prettier": "npx prettier . --check",
"prettier:fix": "npx prettier . --write --log-level=warn",
"test": "node --test",
"versions": "npx @msimerson/dependency-version-checker check",
"versions:fix": "npx @msimerson/dependency-version-checker update"
"versions": "npx dependency-version-checker check",
"versions:fix": "npx dependency-version-checker update"
},
"repository": {
"type": "git",
Expand All @@ -36,7 +36,7 @@
"homepage": "https://github.com/haraka/haraka-plugin-dkim#readme",
"devDependencies": {
"@haraka/eslint-config": "1.1.3",
"haraka-test-fixtures": "1.3.5"
"haraka-test-fixtures": "1.3.7"
},
"dependencies": {
"address-rfc2821": "^2.1.2",
Expand Down
2 changes: 1 addition & 1 deletion test/dkim_sign.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ beforeEach(() => {
this.plugin = new fixtures.plugin('dkim')

this.connection = fixtures.connection.createConnection()
this.connection.transaction = fixtures.transaction.createTransaction()
this.connection.init_transaction()
})

describe('get_sender_domain', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/dkim_signer.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ beforeEach(() => {
this.plugin = new fixtures.plugin('dkim')

this.connection = fixtures.connection.createConnection()
this.connection.transaction = fixtures.transaction.createTransaction()
this.connection.init_transaction()
// this.connection.transaction.mail_from = {}
})

Expand Down
3 changes: 2 additions & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('uses text fixtures', () => {

it('sets up a transaction', () => {
this.connection = fixtures.connection.createConnection({})
this.connection.transaction = fixtures.transaction.createTransaction({})
this.connection.init_transaction()
assert.ok(this.connection.transaction.header)
})
})
Expand All @@ -51,6 +51,7 @@ const expectedCfg = {
'From, Sender, Reply-To, Subject, Date, Message-ID, To, Cc, MIME-Version',
},
verify: {
enabled: true,
timeout: 29,
},
headers_to_sign: [
Expand Down

0 comments on commit 405a975

Please sign in to comment.