-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- initial commit
- Loading branch information
0 parents
commit f5a3d31
Showing
19 changed files
with
1,148 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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
engines: | ||
eslint: | ||
enabled: true | ||
channel: "eslint-8" | ||
config: | ||
config: ".eslintrc.yaml" | ||
|
||
ratings: | ||
paths: | ||
- "**.js" |
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,25 @@ | ||
env: | ||
node: true | ||
es6: true | ||
mocha: true | ||
es2020: true | ||
|
||
plugins: | ||
- haraka | ||
|
||
extends: | ||
- eslint:recommended | ||
- plugin:haraka/recommended | ||
|
||
rules: | ||
indent: [2, 2, {"SwitchCase": 1}] | ||
|
||
root: true | ||
|
||
globals: | ||
OK: true | ||
CONT: true | ||
DENY: true | ||
DENYSOFT: true | ||
DENYDISCONNECT: true | ||
DENYSOFTDISCONNECT: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
### system info | ||
|
||
Please report your OS, Node version, and Haraka version by running this shell script on your Haraka server and replacing this section with the output. | ||
|
||
echo "Haraka | $(haraka -v)"; echo " --- | :--- "; echo "Node | $(node -v)"; echo "OS | $(uname -a)"; echo "openssl | $(openssl version)" | ||
|
||
### Expected behavior | ||
|
||
### Observed behavior | ||
|
||
### Steps to reproduce |
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,12 @@ | ||
Changes proposed in this pull request: | ||
|
||
- | ||
- | ||
|
||
Fixes # | ||
|
||
Checklist: | ||
- [ ] docs updated | ||
- [ ] tests updated | ||
- [ ] Changes.md updated | ||
- [ ] package.json.version bumped |
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,10 @@ | ||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "npm" | ||
directory: "/" | ||
schedule: | ||
interval: "monthly" | ||
allow: | ||
- dependency-type: production |
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,22 @@ | ||
name: CI | ||
|
||
on: [ push, pull_request ] | ||
|
||
env: | ||
CI: true | ||
|
||
jobs: | ||
lint: | ||
uses: haraka/.github/.github/workflows/lint.yml@master | ||
|
||
# coverage: | ||
# uses: haraka/.github/.github/workflows/coverage.yml@master | ||
# secrets: inherit | ||
|
||
ubuntu: | ||
needs: [ lint ] | ||
uses: haraka/.github/.github/workflows/ubuntu.yml@master | ||
|
||
windows: | ||
needs: [ lint ] | ||
uses: haraka/.github/.github/workflows/windows.yml@master |
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,13 @@ | ||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
schedule: | ||
- cron: '18 7 * * 4' | ||
|
||
jobs: | ||
codeql: | ||
uses: haraka/.github/.github/workflows/codeql.yml@master |
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,17 @@ | ||
name: publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- package.json | ||
|
||
env: | ||
CI: true | ||
|
||
jobs: | ||
publish: | ||
uses: haraka/.github/.github/workflows/publish.yml@master | ||
secrets: inherit | ||
|
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,45 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules | ||
jspm_packages | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
package-lock.json | ||
bower_components | ||
# Optional npm cache directory | ||
.npmrc | ||
.idea | ||
.DS_Store | ||
haraka-update.sh |
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,3 @@ | ||
[submodule ".release"] | ||
path = .release | ||
url = [email protected]:msimerson/.release.git |
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,59 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules | ||
jspm_packages | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
package-lock.json | ||
bower_components | ||
# Optional npm cache directory | ||
.npmrc | ||
|
||
.idea | ||
.DS_Store | ||
haraka-update.sh | ||
|
||
.github | ||
.release | ||
.codeclimate.yml | ||
.editorconfig | ||
.gitignore | ||
.gitmodules | ||
.lgtm.yml | ||
appveyor.yml | ||
codecov.yml | ||
.travis.yml | ||
.eslintrc.yaml | ||
.eslintrc.json |
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,3 @@ | ||
## 1.0.0 - 2023-12-15 | ||
|
||
- Initial release |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2017 Haraka | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,107 @@ | ||
[![CI Test Status][ci-img]][ci-url] | ||
[![Code Climate][clim-img]][clim-url] | ||
|
||
[![NPM][npm-img]][npm-url] | ||
|
||
# haraka-plugin-dns-lists | ||
|
||
## dns block lists | ||
|
||
Looks up the connecting IP address in an IP list. Remote hosts found in the list are rejected. | ||
|
||
|
||
## dns allow lists | ||
|
||
Looks up the connecting IP address in an IP list. When an IP matches, this plugin returns OK for all hooks up to hook\_data. | ||
|
||
IMPORTANT! The order of plugins in config/plugins is important when this feature is used. It should be listed *before* any plugins that you wish to skip, but after any plugins that accept recipients. | ||
|
||
|
||
## INSTALL | ||
|
||
```sh | ||
cd /path/to/local/haraka | ||
npm install haraka-plugin-dns-list | ||
echo "dns-list" >> config/plugins | ||
service haraka restart | ||
``` | ||
|
||
### Configuration | ||
|
||
If the default configuration is insufficient, copy the config file from the distribution into your haraka config dir and modify it: | ||
|
||
```sh | ||
cp node_modules/haraka-plugin-dns-list/config/dns-list.ini config/dns-list.ini | ||
$EDITOR config/dns-list.ini | ||
``` | ||
|
||
dns-lists.ini - INI format with options described below: | ||
|
||
#### [main] periodic_checks=30 | ||
|
||
If enabled, this will check all the zones every n minutes. The minimum value that will be accepted here is 5. Any value less than 5 will cause the checks to be run at start-up only. | ||
|
||
The checks confirm that the list is responding and that it is not listing the world. If any errors are detected, then the zone is disabled and will be re-checked on the next test. If a zone subsequently starts working correctly then it will be re-enabled. | ||
|
||
|
||
* [block] zones | ||
|
||
A comma or semi-colon list of zones to query. | ||
|
||
* search: (default: first) | ||
|
||
first: consider first DNSBL response conclusive. End processing. | ||
all: process all DNSBL results | ||
|
||
|
||
* reject (default: true) | ||
|
||
Reject connections from IPs that are blacklisted. Setting this to false | ||
makes dnsbl informational. reject=false is best used in conjunction with | ||
plugins like [karma](/manual/plugins/karma.html) that employ a scoring | ||
engine to make choices about message delivery. | ||
|
||
|
||
|
||
#### [stats] enable=true | ||
|
||
To use this feature you must have installed and configured the 'redis' plugin. | ||
|
||
When enabled, this will record several list statistics to redis. | ||
|
||
It will track the total number of queries (TOTAL) and the average response time (AVG\_RT) and the return type (e.g. LISTED or ERROR) to a redis hash where the key is 'dns-list-stat:zone' and the hash field is the response type. | ||
|
||
It will also track the positive response overlap between the lists in another redis hash where the key is 'dns-list-overlap:zone' and the hash field is the other list names. | ||
|
||
Example: | ||
<pre><code>redis 127.0.0.1:6379> hgetall dns-list-stat:zen.spamhaus.org | ||
1) "TOTAL" | ||
2) "23" | ||
3) "ENOTFOUND" | ||
4) "11" | ||
5) "LISTED" | ||
6) "12" | ||
7) "AVG_RT" | ||
8) "45.5" | ||
redis 127.0.0.1:6379> hgetall dns-list-overlap:zen.spamhaus.org | ||
1) "b.barracudacentral.org" | ||
2) "1" | ||
3) "bl.spamcop.net" | ||
4) "1" | ||
5) "TOTAL" | ||
6) "1" | ||
</code></pre> | ||
|
||
* [stats] redis\_host | ||
|
||
In the form of `host:port` this option allows you to specify a different host on which redis runs. | ||
|
||
|
||
<!-- leave these buried at the bottom of the document --> | ||
[ci-img]: https://github.com/haraka/haraka-plugin-dns-list/actions/workflows/ci.yml/badge.svg | ||
[ci-url]: https://github.com/haraka/haraka-plugin-dns-list/actions/workflows/ci.yml | ||
[clim-img]: https://codeclimate.com/github/haraka/haraka-plugin-dns-list/badges/gpa.svg | ||
[clim-url]: https://codeclimate.com/github/haraka/haraka-plugin-dns-list | ||
[npm-img]: https://nodei.co/npm/haraka-plugin-dns-list.png | ||
[npm-url]: https://www.npmjs.com/package/haraka-plugin-dns-list | ||
|
Oops, something went wrong.