-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
36 additions
and
12 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: [ pull_request, push ] | ||
|
||
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
; [redis] | ||
; host=127.0.0.1 | ||
; port=6379 | ||
; db=0 | ||
; enabled=true | ||
|
||
[routes] | ||
matt@example.com=192.168.76.66 | ||
bad@example.com=127.0.0.1:26 | ||
mixEd@examPle.com=172.16.1.1 |
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,7 @@ | ||
'use strict'; | ||
|
||
const assert = require('assert') | ||
const path = require('path') | ||
|
||
const Address = require('address-rfc2821').Address; | ||
const fixtures = require('haraka-test-fixtures'); | ||
|
@@ -23,6 +24,7 @@ const hmail = { | |
function file_setup (done) { | ||
this.server = {}; | ||
this.plugin = new fixtures.plugin('index'); | ||
this.plugin.config = this.plugin.config.module_config(path.resolve('test')); | ||
|
||
this.plugin.register(); | ||
this.connection = fixtures.connection.createConnection(); | ||
|
@@ -61,12 +63,10 @@ describe('haraka-plugin-recipient-routes', function () { | |
assert.equal(rc, undefined); | ||
assert.equal(msg, undefined); | ||
done() | ||
}, this.connection, [ new Address('<matt@example.com>') ]); | ||
}, this.connection, [ new Address('<miss@example.com>') ]); | ||
}) | ||
|
||
it('hit returns OK', function (done) { | ||
this.plugin.route_list = { '[email protected]': '192.168.1.1' }; | ||
|
||
this.plugin.rcpt(function (rc, msg) { | ||
assert.equal(rc, OK); | ||
assert.equal(msg, undefined); | ||
|
@@ -75,7 +75,6 @@ describe('haraka-plugin-recipient-routes', function () { | |
}) | ||
|
||
it('missing domain', function (done) { | ||
this.plugin.route_list = { '[email protected]': '192.168.1.1' }; | ||
try { | ||
this.plugin.rcpt(function (rc, msg) { | ||
assert.ok(false) | ||
|
@@ -87,6 +86,14 @@ describe('haraka-plugin-recipient-routes', function () { | |
done() | ||
} | ||
}) | ||
|
||
it('lowers mixed case routes', function () { | ||
assert.deepEqual(this.plugin.route_list, { | ||
"[email protected]": "127.0.0.1:26", | ||
"[email protected]": "192.168.76.66", | ||
'[email protected]': '172.16.1.1', | ||
}) | ||
}) | ||
}) | ||
|
||
describe('rcpt redis', function () { | ||
|