Mail::...daries(3pm)
π NAME π
Bestie, welcome to Mail::SpamAssassin::RegistryBoundaries β it's literally the domain delegation rules module, no cap. It knows where the DNS registry boundary lives so you don't have to guess. π
π¦ METHODS π¦
So like, here are the three little functions this module serves up, and they all ate. π
β¨ split_domain
($hostname, $domain) = split_domain ($fqdn, $is_ascii)
Okay so this one takes a fully-qualified hostname and cuts it into two pieces β the hostname part and the domain part β and it splits right at the DNS registry boundary. Iconic behaviour, honestly. π«Ά
Examples, because seeing it is believing:
"www.foo.com" => ( "www", "foo.com" )
"www.foo.co.uk" => ( "www", "foo.co.uk" )
And listen β if $is_ascii is given and true, it skips the idn_to_ascii() conversion. Just skips it. Bye. π
πΈ trim_domain
$domain = trim_domain($fqdn, $is_ascii)
Same energy as split_domain, except it cuts a fully-qualified hostname into the hostname part and the domain part and hands you back just the domain. The hostname half? Not invited. π
Examples:
"www.foo.com" => "foo.com"
"www.foo.co.uk" => "foo.co.uk"
And again, if $is_ascii is given and true, idn_to_ascii() conversion gets skipped. Same rule, same vibe. β¨
π is_domain_valid
$ok = is_domain_valid($dom, $is_ascii)
This is the vibe check function, fr fr. It returns 1 if the domain/hostname uses a valid known TLD, and "undef" otherwise. That's it, that's the whole thing. π¦
And yeah β if $is_ascii is given and true, idn_to_ascii() conversion is skipped. (Noticing a pattern? Me too. It's consistent and I respect it. π)
β οΈ Okay important, bestie, don't skip this: this function only checks the TLD validity and nothing else. Nothing. Else. So if you need to verify that the complete fqdn is in a valid legal format, Util::is_fqdn_valid() can additionally be used. Two checks, two jobs, no overlap. Periodt. π
That's the whole page, and every single detail is still here β not me being responsible with your facts or anything. π
This was served to you as part of the User Contributed Perl Documentation, riding on perl v5.40.1, dated 2026-07-23. Slay, thanks for reading, mwah. π
π¦ 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