Mail::...IDNSBL(3pm)

Mail::...IDNSBL(3pm) πŸ’–

ok bestie, sit down, hydrate, because this is the manual page for Mail::...IDNSBL (that's a SpamAssassin plugin, yes the perl one, don't panic) and she is long, so we're doing this in parts. this is part 1. buckle up πŸŽ€


✨ NAME ✨

URIDNSBL β€” look up URLs against DNS blocklists πŸ”

that's it. that's the whole name section. short queen, iconic behavior πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

loadplugin    Mail::SpamAssassin::Plugin::URIDNSBL
uridnsbl      URIBL_SBLXBL    sbl-xbl.spamhaus.org.   TXT

literally that's the whole setup. two lines. she's low-maintenance, ngl ✨


πŸ’œ DESCRIPTION πŸ’œ

okay so here's the vibe of how this thing actually works, and honestly it's giving detective energy πŸ•΅οΈβ™€οΈ

it analyses your message text and the HTML inside it, hunting for URLs. then it pulls the host names out of those URLs. then β€” and this is the fun part β€” it goes and queries a bunch of DNS blocklists to check on them πŸ‘‘

and what exactly is it asking the blocklists about? bestie, options. it can look up either:

  • the IP addresses of these hosts β€” that's uridnsbl,a πŸ”₯
  • their nameservers β€” that's uridnsbl,ns 🌸
  • the domain names of these hosts β€” that's urirhsbl ✨
  • the domain names of their nameservers β€” that's urinsrhsbl, urifullnsrhsbl πŸ¦‹

four whole flavors. she contains multitudes πŸ’…


πŸŽ€ USER SETTINGS πŸŽ€

this is where you, the user, get to have opinions. and there are three settings, so let's go one by one πŸ’–


skip_uribl_checks ( 0 | 1 ) (default: 0)

turning on the skip_uribl_checks setting will disable the URIDNSBL plugin. like, completely. off. gone. no more URI DNSBL checks from her πŸ’€

by default, though, SpamAssassin will run URI DNSBL checks. so if you don't touch this, she's working, okay? she's doing her job 🫢

but here's the thing β€” if you only want to shut off some blocklists and not the whole plugin, you've got two other ways to do that:

  • set a score of a corresponding rule to 0, or
  • use the uridnsbl_skip_domain parameter (more on that below πŸ‘‡)

also!! see also a related configuration parameter called skip_rbl_checks, which controls the DNSEval plugin (documented in the Conf man page). different plugin, similar name, don't get them twisted bestie 😭


uridnsbl_skip_domain domain1 domain2 ...

give this one a domain β€” or a whole list of domains β€” and it'll skip them for the URIBL checks. 🌈

and omg this is so useful, actually. it's perfect for specifying those extremely common domains that are absolutely never gonna end up on a URIBL. you know the ones. everybody links to them. example.com energy. so why waste the lookup, right? πŸ™ˆ

and a lil detail that matters: in addition to the trimmed domain, the full hostname is also checked from the list. so it's not just doing the short version, it's doing both. thorough queen ⭐


clear_uridnsbl_skip_domain [domain1 domain2 ...]

okay so this one cleans up after you 🧹✨ and she behaves in two different ways depending on whether you feed her anything.

  • no argument given? then it clears the entire list of domains declared by uridnsbl_skip_domain configuration directives so far. and listen β€” any subsequent uridnsbl_skip_domain directives will start creating a new list of skip domains. fresh start, clean slate, new era πŸ’…
  • given a list of domains as arguments? then only the specified domains are removed from the list of skipped domains. surgical. precise. she knows what she's doing πŸ”₯

okay bestie that's part 1, and there is more coming, so don't go anywhere πŸ˜ŒπŸ’–

πŸ’… RULE DEFINITIONS AND PRIVILEGED SETTINGS πŸ’…

okay bestie, this is the part where you actually set stuff up. these are the directives that go in your config. don't be scared, i got you 🫢


🌸 uridnsbl NAME_OF_RULE dnsbl_zone lookuptype

Specify a lookup. NAME_OF_RULE is the name of the rule to be used, dnsbl_zone is the zone to look up IPs in, and lookuptype is the type of lookup (TXT or A). ✨ Heads up tho: you also have to define a body-eval rule calling check_uridnsbl() to actually use this. no cap.

How it works: it collects domain names from URLs and queries DNS blocklists β€” either with an IP address of host names found in URLs, or with IP addresses of their name servers β€” depending on tflags, like this:

  • If the corresponding body rule has a tflag 'a', the DNS blocklist will be queried with an IP address of a host found in URLs.
  • If the corresponding body rule has a tflag 'ns', DNS will be queried for name servers (NS records) of a domain name found in URLs, then those name server names get resolved to their IP addresses, which in turn get sent to the DNS blocklist. πŸŒ€

The Tflags directive may specify either 'a' or 'ns' or both flags. And if neither of those two flags is present? The default is 'ns', which keeps things compatible with pre-3.4 versions of SpamAssassin. 🫢

lowkey important: your choice of tflags has to match the policy and expected use of each DNS blocklist, and it's normally not a local decision. bestie don't freestyle this one. as an example, a blocklist expecting queries resulting from an 'a' tflag is a "black_a.txt" ( http://www.uribl.com/datasets.shtml ). πŸ“‹

Example:

uridnsbl        URIBL_SBLXBL    sbl-xbl.spamhaus.org.   TXT
body            URIBL_SBLXBL    eval:check_uridnsbl('URIBL_SBLXBL')
describe        URIBL_SBLXBL    Contains a URL listed in the SBL/XBL blocklist
tflags          URIBL_SBLXBL    net ns

πŸ¦‹ uridnssub NAME_OF_RULE dnsbl_zone lookuptype subtest

Specify a DNSBL-style domain lookup with a sub-test. NAME_OF_RULE is the name of the rule to be used, dnsbl_zone is the zone to look up IPs in, and lookuptype is the type of lookup (TXT or A). πŸ’«

Tflags 'ns' and 'a' on a corresponding body rule are recognized and mean the same thing as they do in the uridnsbl directive.

subtest is a sub-test to run against the returned data. The sub-test may be in one of the following forms: m, n1-n2, or n/m, where n,n1,n2,m can be any of: decimal digits, 0x followed by up to 8 hexadecimal digits, or an IPv4 address in quad-dot form. πŸ‘€

The 'A' records (IPv4 dotted address) as returned by DNSBLs lookups are converted into a numerical form (r) and checked against the specified sub-test as follows:

  • for a range n1-n2 the following must be true:
(r >= n1 && r <= n3)
  • for a n/m form the following must be true:
(r & m) == (n & m)
  • for a single value in quad-dot form the following must be true:
r == n
  • for a single decimal or hex form the following must be true:
((r & n) != 0) && ((r & 0xff000000) == 0x7f000000), i.e. within
127.0.0.0/8

Some typical examples of a sub-test are: 127.0.1.2, 127.0.1.20-127.0.1.39, 127.0.1.0/255.255.255.0, 0.0.0.16/0.0.0.16, 0x10/0x10, 16, 0x10 . 🌈

Note that, just like with uridnsbl, you must also define a body-eval rule calling check_uridnsbl() to use this.

Example:

uridnssub   URIBL_DNSBL_4    dnsbl.example.org.   A    127.0.0.4
uridnssub   URIBL_DNSBL_8    dnsbl.example.org.   A    8

πŸŽ€ urirhsbl NAME_OF_RULE rhsbl_zone lookuptype

Specify a RHSBL-style domain lookup. NAME_OF_RULE is the name of the rule to be used, rhsbl_zone is the zone to look up domain names in, and lookuptype is the type of lookup (TXT or A). And yep β€” you also need to define a body-eval rule calling check_uridnsbl() to use this. πŸ’–

An RHSBL zone is one where the domain name is looked up as a string; e.g. a URI using the domain "foo.com" will cause a lookup of "foo.com.uriblzone.net". ✨

Now here's the tea: hostnames get trimmed to the domain portion in the URIBL lookup, so the domain "foo.bar.com" will look up "bar.com.uriblzone.net", and "foo.bar.co.uk" will look up "bar.co.uk.uriblzone.net". Using tflag "notrim" will force a full hostname lookup β€” but the specific uribl must support this method. πŸ™ˆ

And if a URI consists of an IP address instead of a hostname? The IP address is looked up (using the standard reversed quads method) in each rhsbl_zone. πŸ”„

Example:

urirhsbl        URIBL_RHSBL    rhsbl.example.org.   TXT

🧚 urirhssub NAME_OF_RULE rhsbl_zone lookuptype subtest

Specify a RHSBL-style domain lookup with a sub-test. NAME_OF_RULE is the name of the rule to be used, rhsbl_zone is the zone to look up domain names in, and lookuptype is the type of lookup (TXT or A). πŸ’œ

subtest is a sub-test to run against the returned data. The sub-test may be in one of the following forms: m, n1-n2, or n/m, where n,n1,n2,m can be any of: decimal digits, 0x followed by up to 8 hexadecimal digits, or an IPv4 address in quad-dot form. πŸ‘‘

The 'A' records (IPv4 dotted address) as returned by DNSBLs lookups are converted into a numerical form (r) and checked against the specified sub-test as follows:

  • for a range n1-n2 the following must be true:
(r >= n1 && r <= n2)
  • for a n/m form the following must be true:
(r & m) == (n & m)
  • for a single value in quad-dot form the following must be true:
r == n
  • for a single decimal or hex form the following must be true:
((r & n) != 0) && ((r & 0xff000000) == 0x7f000000), i.e. within
127.0.0.0/8

Some typical examples of a sub-test are: 127.0.1.2, 127.0.1.20-127.0.1.39, 127.2.3.0/255.255.255.0, 0.0.0.16/0.0.0.16, 0x10/0x10, 16, 0x10 . 🌸

Note that, as with urirhsbl, you must also define a body-eval rule calling check_uridnsbl() to use this. Hostname to domain trimming is also done similarly. βœ‚οΈ

Example:

urirhssub   URIBL_RHSBL_4    rhsbl.example.org.   A    127.0.0.4
urirhssub   URIBL_RHSBL_8    rhsbl.example.org.   A    8

πŸ’« urinsrhsbl NAME_OF_RULE rhsbl_zone lookuptype

Perform a RHSBL-style domain lookup against the contents of the NS records for each URI. In other words, a URI using the domain "foo.com" will cause an NS lookup to take place; assuming that domain has an NS of "ns0.bar.com", that will cause a lookup of "bar.com.uriblzone.net". πŸŒ€ Note that hostnames get stripped from both the domain used in the URI and the domain in the lookup.

NAME_OF_RULE is the name of the rule to be used, rhsbl_zone is the zone to look up domain names in, and lookuptype is the type of lookup (TXT or A).

Note that, as with urirhsbl, you must also define a body-eval rule calling check_uridnsbl() to use this.

⭐ urinsrhssub NAME_OF_RULE rhsbl_zone lookuptype subtest

Specify a RHSBL-style domain-NS lookup, as above, with a sub-test. NAME_OF_RULE is the name of the rule to be used, rhsbl_zone is the zone to look up domain names in, and lookuptype is the type of lookup (TXT or A). subtest is the sub-test to run against the returned data; see "urirhssub". πŸ‘€

Note that, as with urirhsbl, you must also define a body-eval rule calling check_uridnsbl() to use this.

🌈 urifullnsrhsbl NAME_OF_RULE rhsbl_zone lookuptype

Perform a RHSBL-style domain lookup against the contents of the NS records for each URI. In other words, a URI using the domain "foo.com" will cause an NS lookup to take place; assuming that domain has an NS of "ns0.bar.com", that will cause a lookup of "ns0.bar.com.uriblzone.net". πŸ¦‹

NAME_OF_RULE is the name of the rule to be used, rhsbl_zone is the zone to look up domain names in, and lookuptype is the type of lookup (TXT or A).

Note that, as with urirhsbl, you must also define a body-eval rule calling check_uridnsbl() to use this.

πŸ“ urifullnsrhssub NAME_OF_RULE rhsbl_zone lookuptype subtest

Specify a RHSBL-style domain-NS lookup, as above, with a sub-test. NAME_OF_RULE is the name of the rule to be used, rhsbl_zone is the zone to look up domain names in, and lookuptype is the type of lookup (TXT or A). subtest is the sub-test to run against the returned data; see "urirhssub". ✨

Note that, as with urirhsbl, you must also define a body-eval rule calling check_uridnsbl() to use this.

🎯 tflags NAME_OF_RULE ips_only

Only URIs containing IP addresses as the "host" component will be matched against the named "urirhsbl"/"urirhssub" rule.


🌷 tflags NAME_OF_RULE domains_only

Only URIs containing a non-IP-address "host" component will be matched against the named "urirhsbl"/"urirhssub" rule. (so like, lil inverse of the one above πŸ’•)


πŸ” tflags NAME_OF_RULE ns

The 'ns' flag may be applied to rules corresponding to uridnsbl and uridnssub directives. Host names from URLs will be mapped to their name server IP addresses (a NS lookup followed by an A lookup), which in turn will be sent to blocklists. This is the default when neither 'a' nor 'ns' flags are specified. πŸ‘‘


πŸ…°οΈ tflags NAME_OF_RULE a

The 'a' flag may be applied to rules corresponding to uridnsbl and uridnssub directives. Host names from URLs will be mapped to their IP addresses, which will be sent to blocklists. And when both 'ns' and 'a' flags are specified, both queries will be performed. double the queries, double the fun πŸ”₯


βœ‚οΈ tflags NAME_OF_RULE notrim

The full hostname component will be matched against the named "urirhsbl"/"urirhssub" rule, instead of using the trimmed domain. This works better, but the specific uribl must support this method. (say it with me bestie: must support this method πŸ™ˆ)


πŸ‘‘ ADMINISTRATOR SETTINGS πŸ‘‘

πŸ“Š uridnsbl_max_domains N (default: 20)

The maximum number of domains to look up.

πŸ“§ parse_dkim_uris ( 0 / 1 )

Include DKIM uris in lookups. This option is documented in Mail::SpamAssassin::Conf.

🚫 uridnsbl_skip_mailto ( 0 / 1) (default: 1)

Skip mailto links on uris lookups.


🏷️ TAGS 🏷️

The following tags are added to the set, available for use in reports, header fields, other plugins, etc.:

  • _URIHOSTS_
    • Hosts extracted from URIs;
  • _URIDOMAINS_
    • Domains extracted from URIs;
  • _URICNAMES_
    • Dns CNAMEs of hosts extracted from URIs;

πŸ“ NOTES πŸ“

The "uridnsbl_timeout" option has been obsoleted by the "rbl_timeout" option. See the "Mail::SpamAssassin::Conf" POD for details on "rbl_timeout". (rip uridnsbl_timeout, you were mid but you served πŸ’€)


and that's the whole page babes πŸ’– this was perl v5.40.1, dated 2026-07-23, and it's the Mail::...IDNSBL(3pm) page β€” go forth and blocklist slayfully, ily, read the Mail::SpamAssassin::Conf POD before you ship anything to prod πŸŽ€βœ¨

πŸ“¦ where this page comes from