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>



More Linux Commands

manpages/editdiff.1.html
editdiff(1) - fix offsets and counts of a hand-edited diff
editdiff.1 - You can use rediff to correct a hand-edited unified diff. Take a copy of the diff you want to edit, and edit it without changing any offsets or cou

manpages/Tcl_SetChannelErrorInterp.3.html
Tcl_SetChannelErrorInterp(3) - functions to create/intercept
The current definition of a Tcl channel driver does not permit the direct return of arbitrary error messages, except for the setting and retrieval of channel op

manpages/XpGetAttributes.3x.html
XpGetAttributes(3x) - Gets an attribute pool from the specif
XpGetAttributes returns a pool, a COMPOUND_TEXT resource string representing the attribute pool specified by type. The caller is expected to free pool when it i

manpages/pthread_equal.3.html
pthread_equal(3) - compare thread IDs - Linux manual page...
The pthread_equal() function compares two thread identifiers. RETURN VALUE If the two thread IDs are equal, pthread_equal() returns a nonzero value; otherwise,

manpages/git-pack-redundant.1.html
git-pack-redundant(1) - Find redundant pack files (ManPage)
This program computes which packs in your repository are redundant. The output is suitable for piping to xargs rm if you are in the root of the repository. git

manpages/peekfd.1.html
peekfd(1) - peek at file descriptors of running processes...
peekfd attaches to a running process and intercepts all reads and writes to file descriptors. You can specify the desired file descriptor numbers or dump all of

manpages/Mail::SpamAssassin::AICache.3pm.html
Mail::SpamAssassin::AICache(3pm) - provide access to cached
This module allows ArchiveIterator to use cached atime information instead of having to read every message separately. PUBLIC METHODS new() Generates a new cach

manpages/confstr.3.html
confstr(3) - get configuration dependent string variables...
confstr() gets the value of configuration-dependent string variables. The name argument is the system variable to be queried. The following variables are suppor

manpages/perlirix.1.html
perlirix(1) - Perl version 5 on Irix systems (Man Page).....
This document describes various features of Irix that will affect how Perl version 5 (hereafter just Perl) is compiled and/or runs. Building 32-bit Perl in Irix

manpages/cpp.1.html
cpp(1) - The C Preprocessor (Commands - Linux man page).....
The C preprocessor, often known as cpp, is a macro processor that is used automatically by the C compiler to transform your program before compilation. It is ca

manpages/XtVaGetSubvalues.3.html
XtVaGetSubvalues(3) - obtain and set widget resources.......
The XtSetValues function starts with the resources specified for the Core widget fields and proceeds down the subclass chain to the widget. At each stage, it wr

manpages/XkbListComponents.3.html
XkbListComponents(3) - List of components for one or more co
You may ask the server for a list of components for one or more component types. The request takes the form of a set of patterns, one pattern for each of the co





We can't live, work or learn in freedom unless the software we use is free.