Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
msimerson committed Nov 19, 2024
1 parent 03219f7 commit bc3ba46
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions 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-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>)|
| :---: | :---: | :---: | :---: | :---: |
| <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>) |
| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |

<sub>this file is maintained by [.release](https://github.com/msimerson/.release)</sub>
9 changes: 6 additions & 3 deletions lib/spf.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,10 @@ class SPF {
switch (result) {
case this.SPF_PASS:
// Store matching "include" mechanisms
this.spf_record_include_match = { ...this.spf_record_include_match, ...recurse.spf_record_include_match }
this.spf_record_include_match = {
...this.spf_record_include_match,
...recurse.spf_record_include_match,
}
this.spf_record_include_match[domain] = recurse.spf_record
return this.SPF_PASS
case this.SPF_FAIL:
Expand Down Expand Up @@ -512,7 +515,7 @@ class SPF {
resolve_method = 'resolve6'
}

let addrs = [];
let addrs = []
try {
addrs = await dns[resolve_method](mx)
} catch (err) {
Expand All @@ -527,7 +530,7 @@ class SPF {
}

this.log_debug(`mech_mx: mx=${mx} addresses=${addrs?.join(',')}`)
addresses = addrs ? addrs.concat(addresses) : [];
addresses = addrs ? addrs.concat(addresses) : []
}

if (!addresses.length) return this.SPF_NONE
Expand Down
5 changes: 4 additions & 1 deletion test/spf.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ describe('SPF', function () {
this.timeout = 3000
this.SPF.count = 0
await this.SPF.check_host('130.211.0.1', 'google.com')
assert.ok(this.SPF.spf_record_include_match?.['_netblocks3.google.com'], 'expected include not found')
assert.ok(
this.SPF.spf_record_include_match?.['_netblocks3.google.com'],
'expected include not found',
)
})
})

0 comments on commit bc3ba46

Please sign in to comment.