Mail::SPF::Util



Mail::SPF::Util

NAME
SYNOPSIS
DESCRIPTION
SEE ALSO
AUTHORS

NAME

Mail::SPF::Util − Mail::SPF utility class

SYNOPSIS

    use Mail::SPF::Util;
    $hostname = Mail::SPF::Util−>hostname;
    $ipv6_address_v4mapped =
        Mail::SPF::Util−>ipv4_address_to_ipv6($ipv4_address);
    $ipv4_address =
        Mail::SPF::Util−>ipv6_address_to_ipv4($ipv6_address_v4mapped);
    $is_v4mapped =
        Mail::SPF::Util−>ipv6_address_is_ipv4_mapped($ipv6_address);
    $ip_address_string  = Mail::SPF::Util−>ip_address_to_string($ip_address);
    $reverse_name       = Mail::SPF::Util−>ip_address_reverse($ip_address);
    $validated_domain = Mail::SPF::Util−>valid_domain_for_ip_address(
        $spf_server, $request,
        $ip_address, $domain,
        $find_best_match,       # defaults to false
        $accept_any_domain      # defaults to false
    );

DESCRIPTION

Mail::SPF::Util is Mail::SPF’s utility class.

Class methods
The following class methods are provided:
hostname
: returns string

Returns the fully qualified domain name ( FQDN ) of the local host.

ipv4_address_to_ipv6($ipv4_address): returns NetAddr::IP; throws
Mail::SPF::EInvalidOptionValue

Converts the specified NetAddr::IP IPv4 address into an IPv4−mapped IPv6 address. Throws a Mail::SPF::EInvalidOptionValue exception if the specified IP address is not an IPv4 address.

ipv6_address_to_ipv4($ipv6_address): returns NetAddr::IP; throws
Mail::SPF::EInvalidOptionValue

Converts the specified NetAddr::IP IPv4−mapped IPv6 address into a proper IPv4 address. Throws a Mail::SPF::EInvalidOptionValue exception if the specified IP address is not an IPv4−mapped IPv6 address.

ipv6_address_is_ipv4_mapped($ipv6_address): returns boolean

Returns true if the specified NetAddr::IP IPv6 address is an IPv4−mapped address, false otherwise.

ip_address_to_string($ip_address): returns string; throws
Mail::SPF::EInvalidOptionValue

Returns the given NetAddr::IP IPv4 or IPv6 address compactly formatted as a string. For IPv4 addresses, this is equivalent to calling NetAddr::IP’s "addr" method. For IPv6 addresses, this is equivalent to calling NetAddr::IP’s "short" method. Throws a Mail::SPF::EInvalidOptionValue exception if the specified object is not a NetAddr::IP IPv4 or IPv6 address object.

ip_address_reverse($ip_address): returns string; throws
Mail::SPF::EInvalidOptionValue

Returns the "in−addr.arpa."/"ip6.arpa." reverse notation of the given NetAddr::IP IPv4 or IPv6 address. Throws a Mail::SPF::EInvalidOptionValue exception if the specified object is not a NetAddr::IP IPv4 or IPv6 address object.

valid_domain_for_ip_address($server, $request, $ip_address, $domain,
$find_best_match = false, $accept_any_domain = false)
: returns string
or undef

Finds a valid domain name for the given NetAddr::IP IP address that matches the given domain or a sub-domain thereof. A domain name is valid for the given IP address if the IP address reverse-maps to that domain name in DNS , and the domain name in turn forward-maps to the IP address. Uses the given Mail::SPF::Server and Mail::SPF::Request objects to perform DNS look-ups. Returns the validated domain name.

If $find_best_match is true, the one domain name is selected that best matches the given domain name, preferring direct matches over sub-domain matches. Defaults to false.

If $accept_any_domain is true, any domain names are considered acceptable, even if they differ completely from the given domain name (which is then effectively unused unless a best match is requested). Defaults to false.

SEE ALSO

Mail::SPF

For availability, support, and license information, see the README file included with Mail::SPF.

AUTHORS

Julian Mehnle <julian@mehnle.net>, Shevek <cpan@anarres.org>






Opportunity


Personal Opportunity - Free software gives you access to billions of dollars of software at no cost. Use this software for your business, personal use or to develop a profitable skill. Access to source code provides access to a level of capabilities/information that companies protect though copyrights. Open source is a core component of the Internet and it is available to you. Leverage the billions of dollars in resources and capabilities to build a career, establish a business or change the world. The potential is endless for those who understand the opportunity.

Business Opportunity - Goldman Sachs, IBM and countless large corporations are leveraging open source to reduce costs, develop products and increase their bottom lines. Learn what these companies know about open source and how open source can give you the advantage.





Free Software


Free Software provides computer programs and capabilities at no cost but more importantly, it provides the freedom to run, edit, contribute to, and share the software. The importance of free software is a matter of access, not price. Software at no cost is a benefit but ownership rights to the software and source code is far more significant.


Free Office Software - The Libre Office suite provides top desktop productivity tools for free. This includes, a word processor, spreadsheet, presentation engine, drawing and flowcharting, database and math applications. Libre Office is available for Linux or Windows.





Free Books


The Free Books Library is a collection of thousands of the most popular public domain books in an online readable format. The collection includes great classical literature and more recent works where the U.S. copyright has expired. These books are yours to read and use without restrictions.


Source Code - Want to change a program or know how it works? Open Source provides the source code for its programs so that anyone can use, modify or learn how to write those programs themselves. Visit the GNU source code repositories to download the source.





Education


Study at Harvard, Stanford or MIT - Open edX provides free online courses from Harvard, MIT, Columbia, UC Berkeley and other top Universities. Hundreds of courses for almost all major subjects and course levels. Open edx also offers some paid courses and selected certifications.


Linux Manual Pages - A man or manual page is a form of software documentation found on Linux/Unix operating systems. Topics covered include computer programs (including library and system calls), formal standards and conventions, and even abstract concepts.