Skip to content

Commit 0f7a23f

Browse files
authored
fix: call skip_hosts via 'this' instead of exports (#11)
- skip configuration was not being set correctly. - also makes the existing "txn, relaying, is_private" test pass
1 parent 973c094 commit 0f7a23f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
### Unreleased
33

4+
- Fix bug where skip configuration was ignored
45

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

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ exports.helo_spf = async function (next, connection, helo) {
8787
const plugin = this;
8888

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

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

0 commit comments

Comments
 (0)