Git Product home page Git Product logo

haraka-plugin-dns-list's Introduction

CI Test Status Code Climate

NPM

haraka-plugin-dns-list

dns lists

Looks up the IP address of the remote host in DNS lists. There are several types of DNS based lists:

block

Block lists (aka: DNSBL) are designed to be used for blocking mail from any host listed in them. Block lists are the most common DNS list type and lists without a type specified are considered block lists. The default action for block lists is to reject the connection. This can be changed by setting reject=false in the zone's settings block.

allow

When the remote IP is found in an allow list, this plugin returns OK for the ehlo, helo, and mail hooks.

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.

karma

Karma lists can have different results for IPs beyond a simple block or allow. See hostkarma.junkemailfilter.com for details.

INSTALL

cd /path/to/local/haraka
npm install haraka-plugin-dns-list
echo "dns-list" >> config/plugins
service haraka restart

Configure

If the default configuration is insufficient, copy the config file from the distribution into your haraka config dir and modify it:

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

Check every DNS zone every N minutes. When the value is less than 5, checks will only be run at start-up.

The checks confirm that lists are responding correctly. When errors are detected, the zone is disabled and will be checked at the next interval. When a zone resumes working correctly it will be enabled.

[main] zones

An array or comma separated list of zones to query.

[main] search: (default: all)

  • first: consider first DNS list response conclusive. End processing.
  • all: process all DNS list results

[stats] enable=true

This feature requires the redis plugin. When enabled, this will record several list statistics to redis:

  • the total number of queries (TOTAL)
  • the average response time (AVG_RT)
  • 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:

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"

[stats] redis_host

In the form of host:port this option allows you to specify a different host on which redis runs.

Per-Zone DNS list settings

The exact name of the DNS zone (as specified above in main.zones) may contain settings about that DNS list.

  • type=[ block, allow, karma ]
  • reject=true (default: true) Reject connections from IPs on block lists. Setting this to false makes dnsbl informational. reject=false is best used in conjunction with plugins like karma that employ a scoring engine to make choices about message delivery.
  • ipv6=true | false

dnswl

ok_helo=false
ok_mail=false

if DNSBL returns OK on the mail hook, it prevents any subsequent mail hooks in other plugins from running. This might include SPF, known senders, karma, recipient plugins, and any other plugins that want to do transaction initialization on hook_mail. It can be dangerous.

haraka-plugin-dns-list's People

Contributors

lnedry avatar msimerson avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

lnedry

haraka-plugin-dns-list's Issues

dns-list: standardize & modernize

  • populate [files] in package.json. Delete .npmignore.
  • automated code linting. #3308
    • dep: eslint-plugin-haraka -> @haraka/eslint-config
    • update 'lint' script in package.json
    • verify 'lint' CI test config
  • lint: remove duplicate / stale rules from .eslintrc
  • automated code formatting (see also #3308)
  • automated CI testing.
    • mostly done, verify that local copy of ci.yml is up-to-date.
  • CONTRIBUTORS: see 3309
  • consistent naming of "special" files like CHANGELOG.md.
  • CHANGELOG: verify links at bottom (due to inconsistent tag naming)
    • latest .release does this, fixes most, and warns of errors it can't fix
  • verify GitHub repo About link points to npm package
  • convert test suites to mocha "style"
    • works great today and with node --test in v18+

introduce timeout in dnsbl

1893998:May 27 19:02:50 in4 haraka[12315]: [DEBUG] [C6F5648A-9BDE-4165-8ADC-7A29D2E87E5D] [core] running connect hook in dnsbl plugin
1895545:May 27 19:03:20 in4 haraka[12315]: [CRIT] [C6F5648A-9BDE-4165-8ADC-7A29D2E87E5D] [core] Plugin dnsbl timed out on hook connect - make sure it calls the callback

There no mechanism in dnsbl plugin/framework present to work nicely around long running resolution process, but there should be one. It would be wonderful to implement this in dns_list_base.js rather than per-plugin.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.