Skip to content

Commit 92acfed

Browse files
authored
Release v1.2.9 (#33)
- Fix crash in mech_mx code, caused by undefined variable if no valid MXs are found #32 - Add new `spf_record_include_match` property to allow for additional filtering - deps: bump versions to latest
1 parent b290862 commit 92acfed

File tree

6 files changed

+21
-13
lines changed

6 files changed

+21
-13
lines changed

.github/workflows/codeql.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ on:
55
branches: [master]
66
pull_request:
77
branches: [master]
8-
schedule:
9-
- cron: '18 7 * * 4'
108

119
jobs:
1210
codeql:

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
44

55
### Unreleased
66

7-
- fix: undefined variable in mech_mx if no valid MX found
7+
### [1.2.9] - 2024-11-19
8+
9+
- fix: undefined variable exception when no MX is found, #32
810
- add: new spf_record_include_match property to allow for additional filtering
11+
- deps: bump versions to latest
912

1013
### [1.2.8] - 2024-10-07
1114

@@ -95,3 +98,4 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
9598
[1.2.4]: https://github.com/haraka/haraka-plugin-spf/releases/tag/v1.2.4
9699
[1.2.5]: https://github.com/haraka/haraka-plugin-spf/releases/tag/v1.2.5
97100
[1.2.7]: https://github.com/haraka/haraka-plugin-spf/releases/tag/v1.2.7
101+
[1.2.9]: https://github.com/haraka/haraka-plugin-spf/releases/tag/v1.2.9

CONTRIBUTORS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This handcrafted artisinal software is brought to you by:
44

5-
| <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-spf/commits?author=msimerson">14</a>) | <img height="80" src="https://avatars.githubusercontent.com/u/550490?v=4"><br><a href="https://github.com/smfreegard">smfreegard</a> (<a href="https://github.com/haraka/haraka-plugin-spf/commits?author=smfreegard">3</a>) | <img height="80" src="https://avatars.githubusercontent.com/u/82041?v=4"><br><a href="https://github.com/gramakri">gramakri</a> (<a href="https://github.com/haraka/haraka-plugin-spf/commits?author=gramakri">1</a>) | <img height="80" src="https://avatars.githubusercontent.com/u/918201?v=4"><br><a href="https://github.com/DoobleD">DoobleD</a> (<a href="https://github.com/haraka/haraka-plugin-spf/commits?author=DoobleD">1</a>) | <img height="80" src="https://avatars.githubusercontent.com/u/8930018?v=4"><br><a href="https://github.com/ne4t0">ne4t0</a> (<a href="https://github.com/haraka/haraka-plugin-spf/commits?author=ne4t0">1</a>) |
6-
| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
5+
| <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-spf/commits?author=msimerson">15</a>) | <img height="80" src="https://avatars.githubusercontent.com/u/550490?v=4"><br><a href="https://github.com/smfreegard">smfreegard</a> (<a href="https://github.com/haraka/haraka-plugin-spf/commits?author=smfreegard">4</a>) | <img height="80" src="https://avatars.githubusercontent.com/u/918201?v=4"><br><a href="https://github.com/DoobleD">DoobleD</a> (<a href="https://github.com/haraka/haraka-plugin-spf/commits?author=DoobleD">2</a>) | <img height="80" src="https://avatars.githubusercontent.com/u/82041?v=4"><br><a href="https://github.com/gramakri">gramakri</a> (<a href="https://github.com/haraka/haraka-plugin-spf/commits?author=gramakri">1</a>) | <img height="80" src="https://avatars.githubusercontent.com/u/8930018?v=4"><br><a href="https://github.com/ne4t0">ne4t0</a> (<a href="https://github.com/haraka/haraka-plugin-spf/commits?author=ne4t0">1</a>) |
6+
| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
77

88
<sub>this file is maintained by [.release](https://github.com/msimerson/.release)</sub>

lib/spf.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,10 @@ class SPF {
362362
switch (result) {
363363
case this.SPF_PASS:
364364
// Store matching "include" mechanisms
365-
this.spf_record_include_match = { ...this.spf_record_include_match, ...recurse.spf_record_include_match }
365+
this.spf_record_include_match = {
366+
...this.spf_record_include_match,
367+
...recurse.spf_record_include_match,
368+
}
366369
this.spf_record_include_match[domain] = recurse.spf_record
367370
return this.SPF_PASS
368371
case this.SPF_FAIL:
@@ -512,7 +515,7 @@ class SPF {
512515
resolve_method = 'resolve6'
513516
}
514517

515-
let addrs = [];
518+
let addrs = []
516519
try {
517520
addrs = await dns[resolve_method](mx)
518521
} catch (err) {
@@ -527,7 +530,7 @@ class SPF {
527530
}
528531

529532
this.log_debug(`mech_mx: mx=${mx} addresses=${addrs?.join(',')}`)
530-
addresses = addrs ? addrs.concat(addresses) : [];
533+
addresses = addrs ? addrs.concat(addresses) : []
531534
}
532535

533536
if (!addresses.length) return this.SPF_NONE

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "haraka-plugin-spf",
3-
"version": "1.2.8",
3+
"version": "1.2.9",
44
"description": "Sender Policy Framework (SPF) plugin for Haraka",
55
"main": "index.js",
66
"files": [
@@ -40,12 +40,12 @@
4040
},
4141
"dependencies": {
4242
"haraka-dsn": "^1.1.0",
43-
"haraka-net-utils": "^1.7.0",
43+
"haraka-net-utils": "^1.7.1",
4444
"ipaddr.js": "^2.2.0",
45-
"nopt": "^7.2.1"
45+
"nopt": "^8.0.0"
4646
},
4747
"devDependencies": {
4848
"@haraka/eslint-config": "^1.1.5",
49-
"haraka-test-fixtures": "^1.3.7"
49+
"haraka-test-fixtures": "^1.3.8"
5050
}
5151
}

test/spf.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ describe('SPF', function () {
112112
this.timeout = 3000
113113
this.SPF.count = 0
114114
await this.SPF.check_host('130.211.0.1', 'google.com')
115-
assert.ok(this.SPF.spf_record_include_match?.['_netblocks3.google.com'], 'expected include not found')
115+
assert.ok(
116+
this.SPF.spf_record_include_match?.['_netblocks3.google.com'],
117+
'expected include not found',
118+
)
116119
})
117120
})

0 commit comments

Comments
 (0)