Git Product home page Git Product logo

haraka-plugin-uribl's Introduction

CI Test Status Code Climate NPM

haraka-plugin-uribl

This plugin extracts URIs and feeds them to RHS based blacklists such as DBL and SEM-FRESH and body URI based DNS blacklists such as SURBL and URIBL.

This plugin will discard any domain name that does not have a valid TLD or any IP address within RFC1918, 127/8 or 169.254/16 (APIPA) and will convert any URI ending in in-addr.arpa into an IP address lookup.

Configuration

This plugin reads configuration from uribl.ini.

The main section defines global settings for all lists and the blacklists zones are specified as INI section headings with the configuration for each zone within that section.

The main section can contain the following options:

  • timeout

    Default: 30

    The total timeout in seconds for each group of lookups. Any group of lookups that takes longer than this will be aborted and the session will continue.

  • max_uris_per_list

    Default: 20

    This option limits the maximum number of unique lookups that will be submitted for each list after the input has been normalized into the query format required for the list. Any lookups greater than the limit will be discarded.

List sections should be named as the zone of the blacklist and can contain the following options:

At least one of the following must be set for any queries to be run for the blacklist.

  • rdns = 1 | true | yes | on | enabled

    Check any rDNS names against the list.

  • helo = 1 | true | yes | on | enabled

    Check the EHLO/HELO argument against the list.

  • envfrom = 1 | true | yes | on | enabled

    Check the MAIL FROM domain against the list.

  • from = 1 | true | yes | on | enabled

    Check the domain portion of the From: header against the list.

  • replyto = 1 | true | yes | on | enabled

    Check the domain portion of the Reply-To: header against the list.

  • msgid = 1 | true | yes | on | enabled

    Check the RHS of the Message-Id: header against the list.

  • body = 1 | true | yes | on | enabled

    Check any URIs found within the body of the message against the list.

The following are optional for each list:

  • custom_msg

    A custom rejection message that will be returned to the SMTP client if the list returns a positive result. If found within the string {uri} will be replaced by the URI value looked up and {zone} will be replaced by the blacklist zone name.

  • validate

    A regular expression that will be tested against the first A record returned by the list. If it does not evaluate to true then the positive result will be discarded. Example: ^(?!127.0.1.255)127. would check that the IP address returned start with 127. and is not 127.0.1.255

  • bitmask

    This is optionally used for lists such as SURBL and URIBL that return bitmask values in the last octet of the returned IP address to combine multiple lists into a single zone. Using this you may specify which lists within the zone you want use.

  • no_ip_lookups = 1 | true | yes | on | enabled

    Specifies that no IP addresses should ever be check against this list. This is required for dbl.spamhaus.org.

  • strip_to_domain= 1 | true | yes | on | enabled

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

Spamhaus DQS

  • dqs_key

DQS key for Spamhaus's DQS mirrors.

Other files

  • data.uribl.excludes

    This contains a list of domains that should never be looked up in any blacklist as they are known good and will never be listed. This helps to keep useless queries to a minimum.

haraka-plugin-uribl's People

Contributors

doobled avatar lnedry avatar msimerson avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

haraka-plugin-uribl's Issues

Issue with data.uribl plugin not looking up excludes

system info

Haraka Haraka.js โ€” Version: 2.8.18
Node v8.11.1
OS Linux 3.10.0-862.2.3.el7.x86_64 haraka/Haraka#1 SMP Wed May 9 18:05:47 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
openssl OpenSSL 1.0.2k-fips 26 Jan 2017

Expected behavior

Plugin data.uribl is used with default settings; i.e. data.uribl.ini and data.uribl.excludes exists in default Haraka folder (/usr/lib/node_modules/Haraka/config). data.uribl.excludes should be scanned to exclude URI checks for listed domains. The default exclude file already has lots of entries.

The source code seems to write to debug that a URI found in the exclude should be logged with "skip: excluded domain:${host}".

Observed behavior

I have an email with URIs in HTML Body that is being excluded because there's one being blacklisted. After checking, I confirm this URI is good. Before we can fully resolve the issue, I wanted to exclude it from the data.uribl check by updating the data.uribl.excludes file.

The content of data.uribl.excludes (either from local config or default config) never seem to be scanned even after restart. I don't see neither any "skip: excluded domain:${host}" in the log even in DEBUG mode.

Doc does not outline any other file/setting to update to make this work.

I checked the latest version code and this does not seem to have changed on the way exclude list is being used. I'll wait before planning an upgrade.

Thanks for anyone's help.

Regards,
Sylvain

Spamhaus false positives with public DNS

We've recently hit issue with
https://www.spamhaus.org/news/article/807/using-our-public-mirrors-check-your-return-codes-now

Log:
2022-08-26T11:34:46.185Z [DEBUG] [data.uribl] (envfrom) found 1 items for lookup
2022-08-26T11:34:46.185Z [DEBUG] [data.uribl] (envfrom) checking: domainexample.cz
2022-08-26T11:34:46.191Z [DEBUG] [data.uribl] domainexample.cz.dbl.spamhaus.org. => (127.255.255.254)
2022-08-26T11:34:46.191Z [INFO] [data.uribl] found domainexample.cz in zone dbl.spamhaus.org (127.255.255.254)
2022-08-26T11:34:46.191Z [INFO] [core] hook=mail plugin=data.uribl function=hook_mail params=[email protected] retval=DENY msg="domainexample.cz listed in dbl.spamhaus.org; see http://www.spamhaus.org/query/dbl?domain=domainexample.cz"

We can fix it either by noticing it in documentation or/and matching 127.0... only (I expect 127.0.* in valid cases only...)

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.