GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  MAIL::SPF::REQUEST (3)

.ds Aq ’

NAME

Mail::SPF::Request - SPF request class

CONTENTS

SYNOPSIS



    use Mail::SPF;

    my $request = Mail::SPF::Request->new(
        versions    => [1, 2],              # optional
        scope       => mfrom,             # or helo, pra
        identity    => fred@example.com,
        ip_address  => 192.168.0.1,
        helo_identity                       # optional,
                    => mta.example.com    #   for %{h} macro expansion
    );

    my @versions    = $request->versions;
    my $scope       = $request->scope;
    my $authority_domain
                    = $request->authority_domain;
    my $identity    = $request->identity;   # localpart@domain or domain
    my $domain      = $request->domain;
    my $localpart   = $request->localpart;
    my $ip_address  = $request->ip_address;     # IPv4 or IPv6 address
    my $ip_address_v6                           # native IPv6 address or
                    = $request->ip_address_v6;  #   IPv4-mapped IPv6 address
    my $helo_identity                           # additional HELO identity
                    = $request->helo_identity;  #   for non-HELO scopes

    my $record      = $request->record;
        # the record selected during processing of the request, may be undef

    $request->state(field => value);
    my $value = $request->state(field);



DESCRIPTION

An object of class <B>Mail::SPF::RequestB> represents an SPF request.

    Constructors

The following constructors are provided:
<B>new(%options)B>: returns Mail::SPF::Request Creates a new SPF request object. The request is considered the root-request for any subsequent sub-requests (see the new_sub_request constructor).

%options is a list of key/value pairs representing any of the following options:
<B>versionsB> A reference to an array of integers listing the versions of SPF records that may be used for the SPF check. Only those record versions that cover the desired scope will actually be used. At least one applicable version must be specified. For a single record version, a simple scalar may be specified instead of an array-ref. Defaults to all versions that cover the desired scope (see below); defaults to <B>[1, 2]B> for the default scope of <B>’mfrom’B>.

The following versions are supported:
<B>1B> Use v=spf1 records.
<B>2B> Use spf2.0 records.

Example: A value of <B>1B> (or <B>[1]B>) means that only v=spf1 records should be used for the SPF check. If at the same time a scope of <B>’pra’B> is specified, a Mail::SPF::EInvalidScope exception will be thrown as v=spf1 records do not cover the PRA scope.

<B>scopeB> A string denoting the authorization scope of the identity that should be checked. Defaults to <B>’mfrom’B>. The following scope values are supported:
<B>’helo’B> The given identity is the HELO parameter of an SMTP transaction (RFC 2821) and should be checked against SPF records that cover the helo scope (v=spf1). See the SPFv1 specification (RFC 4408) for the formal definition of the HELO scope.
<B>’mfrom’B> The given identity is the MAIL FROM parameter of an SMTP transaction (RFC 2821), and should be checked against SPF records that cover the mfrom scope (v=spf1 and spf2.0/mfrom). See the SPFv1 specification (RFC 4408) for the formal definition of the MAIL FROM scope.

Note: In the case of an empty MAIL FROM SMTP transaction parameter (MAIL FROM:<>), you should perform a check with the helo scope instead.

<B>’pra’B> The given identity is the Purported Responsible Address of an internet message (RFC 2822) and should be checked against SPF records that cover the pra scope (spf2.0/pra). See the PRA specification (RFC 4407) for the formal definition of the PRA scope.
<B>authority_domainB> A string denoting the domain name that should be queried for sender policy records. Defaults to the domain of the identity option. There is usually no need to specify the authority_domain option.
<B>identityB> Required. A string denoting the sender identity whose authorization should be checked. This is a domain name for the helo scope, and an e-mail address for the mfrom and pra scopes.

Note: An empty identity must not be passed. In the case of an empty MAIL FROM SMTP transaction parameter, you should perform a check with the helo scope instead.

<B>ip_addressB> Required for checks with the helo, mfrom, and pra scopes. Either a string or a NetAddr::IP object denoting the IP address of the host claiming the identity that is being checked. Can be either an IPv4 or an IPv6 address. An IPv4-mapped IPv6 address (e.g. ’::ffff:192.168.0.1’) is treated as an IPv4 address.
<B>helo_identityB> A string denoting the HELO SMTP transaction parameter in the case that the main identity is of a scope other than helo. This identity is then used merely for the expansion of %{h} macros during the policy evaluation of the main identity. Defaults to <B>undefB>, which will be expanded to <B>’unknown’B>. If the main identity is of the helo scope, this option is unused.

<B>new_sub_request(%options)B>: returns Mail::SPF::Request Must be invoked on an existing request object. Creates a new sub-request object by cloning the invoked request, which is then considered the new request’s super-request. Any specified options (see the new constructor) override the parameters of the super-request. There is usually no need to specify any options besides the authority_domain option.

    Instance methods

The following instance methods are provided:
<B>root_requestB>: returns Mail::SPF::Request Returns the root of the request’s chain of super-requests. Specifically, returns the request itself if it has no super-requests.
<B>super_requestB>: returns Mail::SPF::Request Returns the super-request of the request, or <B>undefB> if there is none.
<B>versionsB>: returns list of string Returns a list of the SPF record versions that are used for request. See the description of the new constructor’s versions option.
<B>scopeB>: returns string Returns the scope of the request. See the description of the new constructor’s scope option.
<B>authority_domainB>: returns string Returns the authority domain of the request. See the description of the new constructor’s authority_domain option.
<B>identityB>: returns string Returns the identity of the request. See the description of the new constructor’s identity option.
<B>domainB>: returns string Returns the identity domain of the request. See the description of the new constructor’s identity option.
<B>localpartB>: returns string Returns the identity localpart of the request. See the description of the new constructor’s identity option.
<B>ip_addressB>: returns NetAddr::IP Returns the IP address of the request as a NetAddr::IP object. See the description of the new constructor’s ip_address option.
<B>ip_address_v6B>: returns NetAddr::IP Like the ip_address method, however, an IPv4 address is returned as an IPv4-mapped IPv6 address (e.g. ’::ffff:192.168.0.1’) to facilitate uniform processing.
<B>helo_identityB>: returns string Returns the HELO SMTP transaction parameter of the request. See the description of the new constructor’s helo_identity option.
<B>recordB>: returns Mail::SPF::Record Returns the SPF record selected during the processing of the request, or <B>undefB> if there is none.
<B>state($field)B>: returns anything
<B>state($field, B>$value<B>)B>: returns anything Provides an interface for storing temporary state information with the request object. This is primarily meant to be used internally by Mail::SPF::Server and other Mail::SPF classes.

If $value is specified, stores it in a state field named $field. Returns the current (new) value of the state field named $field. This method may be used as an lvalue.

SEE ALSO

Mail::SPF, Mail::SPF::Server

<http://tools.ietf.org/html/rfc4408>

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

AUTHORS

Julian Mehnle <julian@mehnle.net>, Shevek <cpan@anarres.org>
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 MAIL::SPF::REQUEST (3) 2016-04-03

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.