Skip to content

Commit

Permalink
Merge pull request #6 from DoobleD/master
Browse files Browse the repository at this point in the history
add support for spamhaus DQS
  • Loading branch information
msimerson committed Jan 6, 2023
2 parents d7beba2 + 8e07c61 commit 9436e14
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@

### Unreleased

### 1.0.7 - 2023-01-05

- handle Spamhaus DQS (#5): add a dqs_key config option and a [dbl.dq.spamhaus.net] zone, disabled by default

### 1.0.6 - 2022-11-28

- test: increase timeout for DNSBL test
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ The following are optional for each list:

Specifies that the list requires hostnames be stripped down to the domain boundaries prior to querying the list. This is required for the [SURBL][3] and [URIBL][4] lists.

Spamhaus DQS
------------

* dqs_key

DQS key for Spamhaus's DQS mirrors.

Other files
-----------

Expand Down
6 changes: 6 additions & 0 deletions config/uribl.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
; not_ipv6_compatible=1
[main]

; spamhaus via Datafeed Query Service (DQS), requires a DQS key. To use, uncomment the
; next two lines, configure the dqs_key, and comment out the standard spamhaus.
;[dbl.dq.spamhaus.net]
;dqs_key=abcdefghijklmnopq123456789

; spamhaus via standard DNSBL. Comment out the next line when using DQS
[dbl.spamhaus.org]
validate=^(?!127\.0\.1\.255|127\.255\.255\.)127\.
; excluding errors, see https://www.spamhaus.org/faq/section/Spamhaus%20DBL#291
Expand Down
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ exports.do_lookups = function (connection, next, hosts, type) {
}

if (!lookup) continue;
if (plugin.cfg[zone].dqs_key) {
lookup = `${lookup}.${plugin.cfg[zone].dqs_key}`;
}
if (!queries[zone]) queries[zone] = {};
if (Object.keys(queries[zone]).length > plugin.cfg.main.max_uris_per_list) {
connection.logwarn(plugin, `discarding lookup ${lookup} for zone ${zone} maximum query limit reached`);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "haraka-plugin-uribl",
"version": "1.0.6",
"version": "1.0.7",
"description": "Haraka plugin that checks domains in emails against URI blacklists",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 9436e14

Please sign in to comment.