Mail::M...ang::Net(3)

πŸ’– Mail::MIMEDefang::Net πŸ’–

okay bestie, so this page is all about Mail::MIMEDefang::Net β€” that's the network-y little sibling of the Mail::MIMEDefang docs, and it's exactly what it says on the tin. πŸ¦‹


✨ NAME ✨

Mail::MIMEDefang::Net β€” network related methods for email filters. periodt. πŸ’…


🌸 DESCRIPTION 🌸

so basically Mail::MIMEDefang::Net is a whole lil collection of methods you can call from your mimedefang-filter to go talk to network services. that's the whole vibe. no cap. ✨


πŸŽ€ METHODS πŸŽ€

expand_ipv6_address

gives you back an IPv6 address where every single zero field is fully written out β€” nothing abbreviated, nothing sneaky. and if any field is shorter than 4 hex digits? it gets padded with zeros. slay. πŸ’œ

reverse_ip_address_for_rbl

hands you the IP address in that reversed format that RBL lookups are obsessed with. iykyk. 🧚

relay_is_blacklisted

returns the result of the lookup (like 127.0.0.2, for example). the parameters are the IP address of the relay host, and the domain of the RBL server. πŸ“

email_is_blacklisted

also returns the result of the lookup (again, think 127.0.0.2). this one takes an email address, the domain of the hashbl server, and the type of hashing you want β€” either MD5 or SHA1. πŸ”₯

is_public_ip4_address $ip_addr

returns true if $ip_addr is a publicly-routable IPv4 address, and false otherwise. simple as that bestie. πŸ‘‘

is_public_ip6_address $ip_addr

same energy, IPv6 edition: true if $ip_addr is a publicly-routable IPv6 address, false if it's not. 🌈

get_mx_ip_addresses $domain [$resolver_object]

goes and grabs the IP addresses of all the MX hosts for whatever domain you hand it. and if that domain has zero MX hosts? it falls back to the A records instead. cute. πŸ’–

md_get_bogus_mx_hosts $domain

returns a list of the "bogus" IP addresses hanging out in $domain's MX records. and what counts as "bogus", you ask? loopback, private, multicast, etc. β€” all the ones that should not be there. πŸ™ˆ

get_ptr_record $ip_address [$resolver_object]

gets you the PTR record for the IP address you pass in. that's it, that's the method. ⭐

md_get_dmarc_record $domain

returns the DMARC record of a domain. boom. πŸ’…

relay_is_blacklisted_multi

this one returns a hash table with one entry for every original domain. the entries in the hash look like:

{ $domain =<gt" $return }>

where $return is one of SERVFAIL, NXDOMAIN, or a list of IP addresses in dotted-quad form. 🫢

relay_is_blacklisted_multi_count

returns a number telling you how many RBLs the host got blacklisted in. just a count, no drama. 😭

relay_is_blacklisted_multi_list

returns an array of the domains where the relay is blacklisted. so you know where the problem is. πŸ”

md_dns_txt($resolver, $name [, $filter])

queries $name for TXT records using the Net::DNS::Resolver object you supplied, and returns the first TXT string it finds β€” or undef on any error (that means NXDOMAIN, SERVFAIL, or just no TXT records at all, all of it). πŸ’€

the optional $filter argument is a Regexp (like qr/^v=spf1\b/i, for example). when you pass one, only a TXT record whose text matches $filter comes back. that's the whole point, honestly β€” it lets callers pick out one specific record type (SPF, BIMI, ...) from a domain that's publishing a bunch of unrelated TXT records all at once. main character filtering energy. πŸ‘‘


and that's the page, bestie!! this was written for version 3.7.1 and dated 2026-07-20 β€” so if you're reading this from the future, hi, ily, hope your filters are clean. πŸ’œβœ¨

πŸ“¦ where this page comes from