forked from haraka/haraka-plugin-spf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- fix: call skip_hosts via 'this' instead of exports haraka#11 - es6: replace `plugin` with `this` haraka#12 - deps: bump versions to latest
- Loading branch information
Showing
5 changed files
with
59 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
name: CI | ||
|
||
on: [ push ] | ||
on: [ push, pull_request ] | ||
|
||
env: | ||
CI: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ beforeEach(function () { | |
this.plugin.timeout = 8000; | ||
this.plugin.load_spf_ini(); | ||
|
||
// uncomment this line to see detailed SPF evaluation | ||
// comment this line to see detailed SPF evaluation | ||
this.plugin.SPF.prototype.log_debug = () => {}; | ||
|
||
this.connection = fixtures.connection.createConnection(); | ||
|
@@ -165,10 +165,10 @@ describe('hook_helo', function () { | |
const test_addr = new Address('<[email protected]>'); | ||
|
||
describe('hook_mail', function () { | ||
it('rfc1918', function (done) { | ||
|
||
this.connection.remote.is_private=true; | ||
this.connection.remote.ip='192.168.1.1'; | ||
it('rfc1918', function (done) { | ||
this.connection.set('remote.is_private', true); | ||
this.connection.set('remote.ip', '192.168.1.1'); | ||
this.plugin.hook_mail(function next () { | ||
assert.equal(undefined, arguments[0]); | ||
done() | ||
|
@@ -190,31 +190,36 @@ describe('hook_mail', function () { | |
delete this.connection.transaction; | ||
this.plugin.hook_mail(function next () { | ||
assert.equal(undefined, arguments[0]); | ||
assert.equal(undefined, arguments[1]); | ||
done() | ||
}, this.connection); | ||
}) | ||
|
||
it('txn, no helo', function (done) { | ||
this.timeout(3000) | ||
this.plugin.cfg.deny.mfrom_fail = false; | ||
this.connection.remote.ip='207.85.1.1'; | ||
this.connection.set('remote.ip', '207.85.1.1'); | ||
this.plugin.hook_mail(function next () { | ||
assert.equal(undefined, arguments[0]); | ||
assert.equal(undefined, arguments[1]); | ||
done() | ||
}, this.connection, [test_addr]); | ||
}) | ||
|
||
it('txn', function (done) { | ||
this.connection.set('remote', 'ip', '207.85.1.1'); | ||
this.connection.set('hello', 'host', 'mail.example.com'); | ||
this.timeout(3000) | ||
this.connection.set('remote.ip', '207.85.1.1'); | ||
this.connection.set('hello.host', 'mail.example.com'); | ||
this.plugin.hook_mail(function next (rc) { | ||
assert.equal(undefined, rc); | ||
done() | ||
}, this.connection, [test_addr]); | ||
}) | ||
|
||
it('txn, relaying', function (done) { | ||
this.timeout(3000) | ||
this.connection.set('remote.ip', '207.85.1.1'); | ||
this.connection.relaying=true; | ||
this.connection.set('relaying', true); | ||
this.connection.set('hello.host', 'mail.example.com'); | ||
this.plugin.hook_mail(function next (rc) { | ||
assert.equal(undefined, rc); | ||
|