Skip to content

Commit

Permalink
fix: call skip_hosts via 'this' instead of exports (haraka#11)
Browse files Browse the repository at this point in the history
- skip configuration was not being set correctly.
-  also makes the existing "txn, relaying, is_private" test pass
  • Loading branch information
gramakri authored Jun 19, 2023
1 parent 973c094 commit 0f7a23f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

### Unreleased

- Fix bug where skip configuration was ignored

### [1.2.0] - 2023-01-19

Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ exports.helo_spf = async function (next, connection, helo) {
const plugin = this;

// bypass auth'ed or relay'ing hosts if told to
const skip_reason = exports.skip_hosts(connection);
const skip_reason = this.skip_hosts(connection);
if (skip_reason) {
connection.results.add(plugin, {skip: `helo(${skip_reason})`});
return next();
Expand Down Expand Up @@ -147,7 +147,7 @@ exports.hook_mail = async function (next, connection, params) {
if (!txn) return next();

// bypass auth'ed or relay'ing hosts if told to
const skip_reason = exports.skip_hosts(connection);
const skip_reason = this.skip_hosts(connection);
if (skip_reason) {
txn.results.add(plugin, {skip: `host(${skip_reason})`});
return next(CONT, `skipped because host(${skip_reason})`);
Expand Down

0 comments on commit 0f7a23f

Please sign in to comment.