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_domainparameter (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_domainconfiguration directives so far. and listen β any subsequenturidnsbl_skip_domaindirectives 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-n2the following must be true:
(r >= n1 && r <= n3)
- for a
n/mform 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 withuridnsbl, you must also define a body-eval rule callingcheck_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-n2the following must be true:
(r >= n1 && r <= n2)
- for a
n/mform 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 withurirhsbl, you must also define a body-eval rule callingcheck_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 withurirhsbl, you must also define a body-eval rule callingcheck_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 withurirhsbl, you must also define a body-eval rule callingcheck_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 withurirhsbl, you must also define a body-eval rule callingcheck_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 withurirhsbl, you must also define a body-eval rule callingcheck_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
- ubuntu stonking: spamassassin 4.0.2+svn1935691-1build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms