Skip to content

Commit

Permalink
fix(mech_MX): crit error on logging undef addrs (#31)
Browse files Browse the repository at this point in the history
Fixes this error:

```
[CRIT] [-] [core] TypeError: Cannot read properties of undefined (reading 'join')
[CRIT] [-] [core]     at SPF.mech_mx (/<path>/Haraka/node_modules/haraka-plugin-spf/lib/spf.js:523:59)
[CRIT] [-] [core]     at async SPF.check_host (/<path>/Haraka/node_modules/haraka-plugin-spf/lib/spf.js:307:22)
```
  • Loading branch information
DoobleD authored Oct 7, 2024
1 parent f624ba2 commit d22a909
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 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.2.8] - 2024-10-07

- fix: mech_MX crit error on logging undef addrs

### [1.2.7] - 2024-08-14

- test: in index.js, unref timers, so test suite exits
Expand Down
4 changes: 2 additions & 2 deletions lib/spf.js
Original file line number Diff line number Diff line change
Expand Up @@ -520,8 +520,8 @@ class SPF {
}
}

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

if (!addresses.length) return this.SPF_NONE
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "haraka-plugin-spf",
"version": "1.2.7",
"version": "1.2.8",
"description": "Sender Policy Framework (SPF) plugin for Haraka",
"main": "index.js",
"files": [
Expand Down

0 comments on commit d22a909

Please sign in to comment.