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