.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Mail::SpamAssassin::Plugin::URIDNSBL 3" .TH Mail::SpamAssassin::Plugin::URIDNSBL 3 2023-07-26 "perl v5.38.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME URIDNSBL \- look up URLs against DNS blocklists .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 2 \& loadplugin Mail::SpamAssassin::Plugin::URIDNSBL \& uridnsbl URIBL_SBLXBL sbl\-xbl.spamhaus.org. TXT .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This works by analysing message text and HTML for URLs, extracting host names from those, then querying various DNS blocklists for either: IP addresses of these hosts (uridnsbl,a) or their nameservers (uridnsbl,ns), or domain names of these hosts (urirhsbl), or domain names of their nameservers (urinsrhsbl, urifullnsrhsbl). .SH "USER SETTINGS" .IX Header "USER SETTINGS" .IP "skip_uribl_checks ( 0 | 1 ) (default: 0)" 4 .IX Item "skip_uribl_checks ( 0 | 1 ) (default: 0)" Turning on the skip_uribl_checks setting will disable the URIDNSBL plugin. .Sp By default, SpamAssassin will run URI DNSBL checks. Individual URI blocklists may be disabled selectively by setting a score of a corresponding rule to 0 or through the uridnsbl_skip_domain parameter. .Sp See also a related configuration parameter skip_rbl_checks, which controls the DNSEval plugin (documented in the Conf man page). .IP "uridnsbl_skip_domain domain1 domain2 ..." 4 .IX Item "uridnsbl_skip_domain domain1 domain2 ..." Specify a domain, or a number of domains, which should be skipped for the URIBL checks. This is very useful to specify very common domains which are not going to be listed in URIBLs. .Sp In addition to trimmed domain, the full hostname is also checked from the list. .IP "clear_uridnsbl_skip_domain [domain1 domain2 ...]" 4 .IX Item "clear_uridnsbl_skip_domain [domain1 domain2 ...]" If no argument is given, then clears the entire list of domains declared by \fIuridnsbl_skip_domain\fR configuration directives so far. Any subsequent \&\fIuridnsbl_skip_domain\fR directives will start creating a new list of skip domains. .Sp When given a list of domains as arguments, only the specified domains are removed from the list of skipped domains. .SH "RULE DEFINITIONS AND PRIVILEGED SETTINGS" .IX Header "RULE DEFINITIONS AND PRIVILEGED SETTINGS" .IP "uridnsbl NAME_OF_RULE dnsbl_zone lookuptype" 4 .IX Item "uridnsbl NAME_OF_RULE dnsbl_zone lookuptype" Specify a lookup. \f(CW\*(C`NAME_OF_RULE\*(C'\fR is the name of the rule to be used, \f(CW\*(C`dnsbl_zone\*(C'\fR is the zone to look up IPs in, and \f(CW\*(C`lookuptype\*(C'\fR is the type of lookup (\fBTXT\fR or \fBA\fR). Note that you must also define a body-eval rule calling \f(CWcheck_uridnsbl()\fR to use this. .Sp This works by collecting domain names from URLs and querying DNS blocklists with an IP address of host names found in URLs or with IP addresses of their name servers, according to tflags as follows. .Sp 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. .Sp 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 these name server names will be resolved to their IP addresses, which in turn will be sent to DNS blocklist. .Sp Tflags directive may specify either 'a' or 'ns' or both flags. In absence of any of these two flags, a default is a 'ns', which is compatible with pre\-3.4 versions of SpamAssassin. .Sp The choice of tflags must correspond to the policy and expected use of each DNS blocklist and is normally not a local decision. As an example, a blocklist expecting queries resulting from an 'a' tflag is a "black_a.txt" ( http://www.uribl.com/datasets.shtml ). .Sp Example: .Sp .Vb 4 \& uridnsbl URIBL_SBLXBL sbl\-xbl.spamhaus.org. TXT \& body URIBL_SBLXBL eval:check_uridnsbl(\*(AqURIBL_SBLXBL\*(Aq) \& describe URIBL_SBLXBL Contains a URL listed in the SBL/XBL blocklist \& tflags URIBL_SBLXBL net ns .Ve .IP "uridnssub NAME_OF_RULE dnsbl_zone lookuptype subtest" 4 .IX Item "uridnssub NAME_OF_RULE dnsbl_zone lookuptype subtest" Specify a DNSBL-style domain lookup with a sub-test. \f(CW\*(C`NAME_OF_RULE\*(C'\fR is the name of the rule to be used, \f(CW\*(C`dnsbl_zone\*(C'\fR is the zone to look up IPs in, and \f(CW\*(C`lookuptype\*(C'\fR is the type of lookup (\fBTXT\fR or \fBA\fR). .Sp Tflags 'ns' and 'a' on a corresponding body rule are recognized and have the same meaning as in the uridnsbl directive. .Sp \&\f(CW\*(C`subtest\*(C'\fR 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 .Sp 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 . .Sp Note that, as with \f(CW\*(C`uridnsbl\*(C'\fR, you must also define a body-eval rule calling \&\f(CWcheck_uridnsbl()\fR to use this. .Sp Example: .Sp .Vb 2 \& uridnssub URIBL_DNSBL_4 dnsbl.example.org. A 127.0.0.4 \& uridnssub URIBL_DNSBL_8 dnsbl.example.org. A 8 .Ve .IP "urirhsbl NAME_OF_RULE rhsbl_zone lookuptype" 4 .IX Item "urirhsbl NAME_OF_RULE rhsbl_zone lookuptype" Specify a RHSBL-style domain lookup. \f(CW\*(C`NAME_OF_RULE\*(C'\fR is the name of the rule to be used, \f(CW\*(C`rhsbl_zone\*(C'\fR is the zone to look up domain names in, and \&\f(CW\*(C`lookuptype\*(C'\fR is the type of lookup (\fBTXT\fR or \fBA\fR). Note that you must also define a body-eval rule calling \f(CWcheck_uridnsbl()\fR to use this. .Sp An RHSBL zone is one where the domain name is looked up, as a string; e.g. a URI using the domain \f(CW\*(C`foo.com\*(C'\fR will cause a lookup of \&\f(CW\*(C`foo.com.uriblzone.net\*(C'\fR. Note that hostnames are trimmed to the domain portion in the URIBL lookup, so the domain \f(CW\*(C`foo.bar.com\*(C'\fR will look up \&\f(CW\*(C`bar.com.uriblzone.net\*(C'\fR, and \f(CW\*(C`foo.bar.co.uk\*(C'\fR will look up \&\f(CW\*(C`bar.co.uk.uriblzone.net\*(C'\fR. Using tflag \f(CW\*(C`notrim\*(C'\fR will force full hostname lookup, but the specific uribl must support this method. .Sp If an URI consists of an IP address instead of a hostname, the IP address is looked up (using the standard reversed quads method) in each \f(CW\*(C`rhsbl_zone\*(C'\fR. .Sp Example: .Sp .Vb 1 \& urirhsbl URIBL_RHSBL rhsbl.example.org. TXT .Ve .IP "urirhssub NAME_OF_RULE rhsbl_zone lookuptype subtest" 4 .IX Item "urirhssub NAME_OF_RULE rhsbl_zone lookuptype subtest" Specify a RHSBL-style domain lookup with a sub-test. \f(CW\*(C`NAME_OF_RULE\*(C'\fR is the name of the rule to be used, \f(CW\*(C`rhsbl_zone\*(C'\fR is the zone to look up domain names in, and \f(CW\*(C`lookuptype\*(C'\fR is the type of lookup (\fBTXT\fR or \fBA\fR). .Sp \&\f(CW\*(C`subtest\*(C'\fR 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 .Sp 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 . .Sp Note that, as with \f(CW\*(C`urirhsbl\*(C'\fR, you must also define a body-eval rule calling \f(CWcheck_uridnsbl()\fR to use this. Hostname to domain trimming is also done similarly. .Sp Example: .Sp .Vb 2 \& urirhssub URIBL_RHSBL_4 rhsbl.example.org. A 127.0.0.4 \& urirhssub URIBL_RHSBL_8 rhsbl.example.org. A 8 .Ve .IP "urinsrhsbl NAME_OF_RULE rhsbl_zone lookuptype" 4 .IX Item "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 \f(CW\*(C`foo.com\*(C'\fR will cause an NS lookup to take place; assuming that domain has an NS of \f(CW\*(C`ns0.bar.com\*(C'\fR, that will cause a lookup of \f(CW\*(C`bar.com.uriblzone.net\*(C'\fR. Note that hostnames are stripped from both the domain used in the URI, and the domain in the lookup. .Sp \&\f(CW\*(C`NAME_OF_RULE\*(C'\fR is the name of the rule to be used, \f(CW\*(C`rhsbl_zone\*(C'\fR is the zone to look up domain names in, and \f(CW\*(C`lookuptype\*(C'\fR is the type of lookup (\fBTXT\fR or \&\fBA\fR). .Sp Note that, as with \f(CW\*(C`urirhsbl\*(C'\fR, you must also define a body-eval rule calling \&\f(CWcheck_uridnsbl()\fR to use this. .IP "urinsrhssub NAME_OF_RULE rhsbl_zone lookuptype subtest" 4 .IX Item "urinsrhssub NAME_OF_RULE rhsbl_zone lookuptype subtest" Specify a RHSBL-style domain-NS lookup, as above, with a sub-test. \&\f(CW\*(C`NAME_OF_RULE\*(C'\fR is the name of the rule to be used, \f(CW\*(C`rhsbl_zone\*(C'\fR is the zone to look up domain names in, and \f(CW\*(C`lookuptype\*(C'\fR is the type of lookup (\fBTXT\fR or \&\fBA\fR). \f(CW\*(C`subtest\*(C'\fR is the sub-test to run against the returned data; see . .Sp Note that, as with \f(CW\*(C`urirhsbl\*(C'\fR, you must also define a body-eval rule calling \&\f(CWcheck_uridnsbl()\fR to use this. .IP "urifullnsrhsbl NAME_OF_RULE rhsbl_zone lookuptype" 4 .IX Item "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 \f(CW\*(C`foo.com\*(C'\fR will cause an NS lookup to take place; assuming that domain has an NS of \f(CW\*(C`ns0.bar.com\*(C'\fR, that will cause a lookup of \f(CW\*(C`ns0.bar.com.uriblzone.net\*(C'\fR. .Sp \&\f(CW\*(C`NAME_OF_RULE\*(C'\fR is the name of the rule to be used, \f(CW\*(C`rhsbl_zone\*(C'\fR is the zone to look up domain names in, and \f(CW\*(C`lookuptype\*(C'\fR is the type of lookup (\fBTXT\fR or \&\fBA\fR). .Sp Note that, as with \f(CW\*(C`urirhsbl\*(C'\fR, you must also define a body-eval rule calling \&\f(CWcheck_uridnsbl()\fR to use this. .IP "urifullnsrhssub NAME_OF_RULE rhsbl_zone lookuptype subtest" 4 .IX Item "urifullnsrhssub NAME_OF_RULE rhsbl_zone lookuptype subtest" Specify a RHSBL-style domain-NS lookup, as above, with a sub-test. \&\f(CW\*(C`NAME_OF_RULE\*(C'\fR is the name of the rule to be used, \f(CW\*(C`rhsbl_zone\*(C'\fR is the zone to look up domain names in, and \f(CW\*(C`lookuptype\*(C'\fR is the type of lookup (\fBTXT\fR or \&\fBA\fR). \f(CW\*(C`subtest\*(C'\fR is the sub-test to run against the returned data; see . .Sp Note that, as with \f(CW\*(C`urirhsbl\*(C'\fR, you must also define a body-eval rule calling \&\f(CWcheck_uridnsbl()\fR to use this. .IP "tflags NAME_OF_RULE ips_only" 4 .IX Item "tflags NAME_OF_RULE ips_only" Only URIs containing IP addresses as the "host" component will be matched against the named "urirhsbl"/"urirhssub" rule. .IP "tflags NAME_OF_RULE domains_only" 4 .IX Item "tflags NAME_OF_RULE domains_only" Only URIs containing a non-IP-address "host" component will be matched against the named "urirhsbl"/"urirhssub" rule. .IP "tflags NAME_OF_RULE ns" 4 .IX Item "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 a default when neither 'a' nor 'ns' flags are specified. .IP "tflags NAME_OF_RULE a" 4 .IX Item "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. When both 'ns' and 'a' flags are specified, both queries will be performed. .IP "tflags NAME_OF_RULE notrim" 4 .IX Item "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. .SH "ADMINISTRATOR SETTINGS" .IX Header "ADMINISTRATOR SETTINGS" .IP "uridnsbl_max_domains N (default: 20)" 4 .IX Item "uridnsbl_max_domains N (default: 20)" The maximum number of domains to look up. .IP "parse_dkim_uris ( 0 / 1 )" 4 .IX Item "parse_dkim_uris ( 0 / 1 )" Include DKIM uris in lookups. This option is documented in Mail::SpamAssassin::Conf. .SH NOTES .IX Header "NOTES" The \f(CW\*(C`uridnsbl_timeout\*(C'\fR option has been obsoleted by the \f(CW\*(C`rbl_timeout\*(C'\fR option. See the \f(CW\*(C`Mail::SpamAssassin::Conf\*(C'\fR POD for details on \f(CW\*(C`rbl_timeout\*(C'\fR.