Mail::...IDetail(3pm)
π NAME π
URIDetail β the little icon that tests URIs using detailed URI info. She's a Mail::...IDetail(3pm) girlie, and she is so detailed it's not even funny. β¨
πΈ SYNOPSIS πΈ
okay so this plugin adds a whole new rule test type called uri_detail, and those rules apply to all the URIs found in the message. all of them. every single one bestie we are not missing a crumb π
loadplugin Mail::SpamAssassin::Plugin::URIDetail
π RULE DEFINITIONS AND PRIVILEGED SETTINGS π
the format for defining a rule goes a little something like this:
uri_detail SYMBOLIC_TEST_NAME key1 =~ /value1/i key2 !~ /value2/ ...
and here are the keys you can play with, bestie π
rawβ the raw URI before any cleaning happens. like, pre-glow-up. example:http://spamassassin.apache%2Eorg/typeβ the tag(s) that referenced theraw_uri. there'sparsed, which is a faked type meaning theraw_urigot parsed out of the rendered text. and there'sredirect, also a faked type, meaning theraw_uriwas discovered by following a URL redirector (go peek at the Redirectors plugin π). when it's a redirect, the tag(s) from the originating URI get preserved on the redirected entry too. iconic behaviour tbh.cleanedβ a list with the raw URI plus all the various cleaned versions of it, likehttp://spamassassin.apache%2Eorg/andhttps://spamassassin.apache.org/.textβ the anchor text(s), aka the text chillin' between<a>and</a>that linked to theraw_uri.domainβ the domain(s) found in the cleaned URIs, trimmed to registrar boundary byMail::SpamAssassin::Util::RegistrarBoundaries(3).hostβ the full host(s) in the cleaned URIs. (supported since SA 3.4.5 π )
π¦ example rules pls π¦
example rule matching a URI where the raw URI matches %2Ebar, the domain bar.com is found, and the type is a (an anchor tag):
uri_detail TEST1 raw =~ /%2Ebar/ domain =~ /^bar\.com$/ type =~ /^a$/
example rule hunting for suspicious https links, because the way they lie:
uri_detail FAKE_HTTPS text =~ /\bhttps:/ cleaned !~ /\bhttps:/
regular expressions should be delimited by slashes. periodt. β¨
negating matches is supported in SpamAssassin 4.0.2 or higher by prefixing the key with an exclamation mark.
example rule looking for links where the text contains id.me but the host is not id.me:
uri_detail FAKE_ID_ME text =~ /\bid\.me\b/ !host =~ /^id\.me$/
π okay the important bit, do not skip π
the difference between '!key =~ ...' and 'key !~ ...' exists because keys can hold multiple values. here's the tea:
'!key =~ ...'is true if none of the values match the regex.'key !~ ...'is true if any of the values do not match the regex.
for example, consider the following data structure:
{
host => {
'id.me' => 1,
'example.com' => 1,
},
text => [
'Login to ID.me'
]
}
the rule 'host !~ /^id\.me$/' would be true, because 'example.com' does not match the regex. π
the rule '!host =~ /^id\.me$/' would be false, because it's the logical negation of 'host =~ /^id\.me$/', which is true since 'id.me' matches the regex. the math is mathing and honestly it's a lot.
β οΈ no cap, super important: there must not be any whitespace between the key and the negation operator. not one single space. she will not tolerate it. π
π and that's the whole page bestie π
this lil masterpiece is Mail::...IDetail(3pm) from perl v5.40.1, dated 2026-07-23 β mwah π go forth and test your URIs in excruciating detail, you absolute main character π«Άπ
π¦ 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