Mail::MIMEDefang::Net - Network related methods for email filters


Mail::MIMEDefang::Net are a set of methods that can be called from mimedefang-filter to call network related services.



Method that returns an IPv6 address with all zero fields explicitly expanded, any field shorter than 4 hex digits will be padded with zeros.


Method that returns the ip address in the appropriately-reversed format used for RBL lookups.


Method that returns the result of the lookup (eg Parameters are the ip address of the relay host and the domain of the rbl server.


Method that returns the result of the lookup (eg Parameters are an email address, the domain of the hashbl server, and the type of hashing (MD5 or SHA1).

is_public_ip4_address $ip_addr

Returns true if $ip_addr is a publicly-routable IPv4 address, false otherwise

is_public_ip6_address $ip_addr

Returns true if $ip_addr is a publicly-routable IPv6 address, false otherwise

get_mx_ip_addresses $domain [\$resolver_object]

Get IP addresses of all MX hosts for given domain. If there are no MX hosts, then return A records.

md_get_bogus_mx_hosts $domain

Returns a list of bogus IP addresses that are in $domain\'s list of MX records. A bogus IP address is loopback/private/multicast/etc.


Method that rerurns a hash table with one entry per original domain. Entries in hash will be: { $domain =<gt $return }>, where $return is one of SERVFAIL, NXDOMAIN or a list of IP addresses as a dotted-quad.


Method that returns a number indicating how many RBLs the host was blacklisted in.


Method that returns an array indicating the domains in which the relay is blacklisted.