forked from smfreegard/Haraka
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Plugin to block RCPT_TO addresses in a list.
- Loading branch information
Showing
3 changed files
with
23 additions
and
0 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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1 @@ | |||
# This is a blocklist for the rcpt_to line. One address per line. |
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,11 @@ | |||
rcpt_to.blocklist | |||
=================== | |||
|
|||
This mail blocks RCPT_TO addresses in a list. | |||
|
|||
Configuration | |||
------------- | |||
|
|||
* rcpt_to.blocklist | |||
|
|||
Contains a list of email addresses to block. |
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,11 @@ | |||
// Block mail from matching anything in the list | |||
var utils = require('./utils'); | |||
|
|||
exports.hook_rcpt = function (next, connection, params) { | |||
var rcpt_to = params[0].address(); | |||
var list = this.config.get('rcpt_to.blocklist', 'list'); | |||
if (utils.in_array(rcpt_to, list)) { | |||
return next(DENY, "Mail to " + rcpt_to + "is not allowed here"); | |||
} | |||
return next(); | |||
} |