| Current File : //usr/local/share/man/man3/Mail::SPF::Request.3 |
.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.30)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{
. if \nF \{
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "Mail::SPF::Request 3"
.TH Mail::SPF::Request 3 "2015-06-13" "perl v5.20.0" "User Contributed Perl Documentation"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
Mail::SPF::Request \- SPF request class
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 1
\& use Mail::SPF;
\&
\& my $request = Mail::SPF::Request\->new(
\& versions => [1, 2], # optional
\& scope => \*(Aqmfrom\*(Aq, # or \*(Aqhelo\*(Aq, \*(Aqpra\*(Aq
\& identity => \*(Aqfred@example.com\*(Aq,
\& ip_address => \*(Aq192.168.0.1\*(Aq,
\& helo_identity # optional,
\& => \*(Aqmta.example.com\*(Aq # for %{h} macro expansion
\& );
\&
\& my @versions = $request\->versions;
\& my $scope = $request\->scope;
\& my $authority_domain
\& = $request\->authority_domain;
\& my $identity = $request\->identity; # \*(Aqlocalpart@domain\*(Aq or \*(Aqdomain\*(Aq
\& 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 => \*(Aqvalue\*(Aq);
\& my $value = $request\->state(\*(Aqfield\*(Aq);
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
An object of class \fBMail::SPF::Request\fR represents an \s-1SPF\s0 request.
.SS "Constructors"
.IX Subsection "Constructors"
The following constructors are provided:
.IP "\fBnew(%options)\fR: returns \fIMail::SPF::Request\fR" 4
.IX Item "new(%options): returns Mail::SPF::Request"
Creates a new \s-1SPF\s0 request object. The request is considered the
\&\fIroot-request\fR for any subsequent sub-requests (see the \*(L"new_sub_request\*(R"
constructor).
.Sp
\&\f(CW%options\fR is a list of key/value pairs representing any of the following
options:
.RS 4
.IP "\fBversions\fR" 4
.IX Item "versions"
A reference to an \fIarray\fR of \fIinteger\fRs listing the versions of \s-1SPF\s0 records
that may be used for the \s-1SPF\s0 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 \fB[1, 2]\fR for the default scope of \fB'mfrom'\fR.
.Sp
The following versions are supported:
.RS 4
.IP "\fB1\fR" 4
.IX Item "1"
Use \f(CW\*(C`v=spf1\*(C'\fR records.
.IP "\fB2\fR" 4
.IX Item "2"
Use \f(CW\*(C`spf2.0\*(C'\fR records.
.RE
.RS 4
.Sp
\&\fIExample\fR: A value of \fB1\fR (or \fB[1]\fR) means that only \f(CW\*(C`v=spf1\*(C'\fR records
should be used for the \s-1SPF\s0 check. If at the same time a scope of \fB'pra'\fR is
specified, a \fIMail::SPF::EInvalidScope\fR exception will be thrown as \f(CW\*(C`v=spf1\*(C'\fR
records do not cover the \s-1PRA\s0 scope.
.RE
.IP "\fBscope\fR" 4
.IX Item "scope"
A string denoting the authorization scope of the identity that should be
checked. Defaults to \fB'mfrom'\fR. The following scope values are supported:
.RS 4
.IP "\fB'helo'\fR" 4
.IX Item "'helo'"
The given identity is the \f(CW\*(C`HELO\*(C'\fR parameter of an \s-1SMTP\s0 transaction (\s-1RFC 2821\s0)
and should be checked against \s-1SPF\s0 records that cover the \f(CW\*(C`helo\*(C'\fR scope
(\f(CW\*(C`v=spf1\*(C'\fR). See the SPFv1 specification (\s-1RFC 4408\s0) for the formal definition
of the \f(CW\*(C`HELO\*(C'\fR scope.
.IP "\fB'mfrom'\fR" 4
.IX Item "'mfrom'"
The given identity is the \f(CW\*(C`MAIL FROM\*(C'\fR parameter of an \s-1SMTP\s0 transaction (\s-1RFC
2821\s0), and should be checked against \s-1SPF\s0 records that cover the \f(CW\*(C`mfrom\*(C'\fR scope
(\f(CW\*(C`v=spf1\*(C'\fR and \f(CW\*(C`spf2.0/mfrom\*(C'\fR). See the SPFv1 specification (\s-1RFC 4408\s0) for
the formal definition of the \f(CW\*(C`MAIL FROM\*(C'\fR scope.
.Sp
\&\fINote\fR: In the case of an empty \f(CW\*(C`MAIL FROM\*(C'\fR \s-1SMTP\s0 transaction parameter (\f(CW\*(C`MAIL FROM:<>\*(C'\fR), you should perform a check with the \f(CW\*(C`helo\*(C'\fR scope instead.
.IP "\fB'pra'\fR" 4
.IX Item "'pra'"
The given identity is the \*(L"Purported Responsible Address\*(R" of an internet
message (\s-1RFC 2822\s0) and should be checked against \s-1SPF\s0 records that cover the
\&\f(CW\*(C`pra\*(C'\fR scope (\f(CW\*(C`spf2.0/pra\*(C'\fR). See the \s-1PRA\s0 specification (\s-1RFC 4407\s0) for the
formal definition of the \s-1PRA\s0 scope.
.RE
.RS 4
.RE
.IP "\fBauthority_domain\fR" 4
.IX Item "authority_domain"
A string denoting the domain name that should be queried for sender policy
records. Defaults to the domain of the \f(CW\*(C`identity\*(C'\fR option. There is usually
no need to specify the \f(CW\*(C`authority_domain\*(C'\fR option.
.IP "\fBidentity\fR" 4
.IX Item "identity"
\&\fIRequired\fR. A string denoting the sender identity whose authorization should
be checked. This is a domain name for the \f(CW\*(C`helo\*(C'\fR scope, and an e\-mail address
for the \f(CW\*(C`mfrom\*(C'\fR and \f(CW\*(C`pra\*(C'\fR scopes.
.Sp
\&\fINote\fR: An empty identity must not be passed. In the case of an empty \f(CW\*(C`MAIL
FROM\*(C'\fR \s-1SMTP\s0 transaction parameter, you should perform a check with the \f(CW\*(C`helo\*(C'\fR
scope instead.
.IP "\fBip_address\fR" 4
.IX Item "ip_address"
\&\fIRequired\fR for checks with the \f(CW\*(C`helo\*(C'\fR, \f(CW\*(C`mfrom\*(C'\fR, and \f(CW\*(C`pra\*(C'\fR scopes. Either a
string or a \fINetAddr::IP\fR object denoting the \s-1IP\s0 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.
.IP "\fBhelo_identity\fR" 4
.IX Item "helo_identity"
A string denoting the \f(CW\*(C`HELO\*(C'\fR \s-1SMTP\s0 transaction parameter in the case that the
main identity is of a scope other than \f(CW\*(C`helo\*(C'\fR. This identity is then used
merely for the expansion of \f(CW\*(C`%{h}\*(C'\fR macros during the policy evaluation of the
main identity. Defaults to \fBundef\fR, which will be expanded to \fB'unknown'\fR.
If the main identity is of the \f(CW\*(C`helo\*(C'\fR scope, this option is unused.
.RE
.RS 4
.RE
.IP "\fBnew_sub_request(%options)\fR: returns \fIMail::SPF::Request\fR" 4
.IX Item "new_sub_request(%options): 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 \fIsuper-request\fR. Any specified options (see the \*(L"new\*(R"
constructor) override the parameters of the super-request. There is usually no
need to specify any options \fIbesides\fR the \f(CW\*(C`authority_domain\*(C'\fR option.
.SS "Instance methods"
.IX Subsection "Instance methods"
The following instance methods are provided:
.IP "\fBroot_request\fR: returns \fIMail::SPF::Request\fR" 4
.IX Item "root_request: 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.
.IP "\fBsuper_request\fR: returns \fIMail::SPF::Request\fR" 4
.IX Item "super_request: returns Mail::SPF::Request"
Returns the super-request of the request, or \fBundef\fR if there is none.
.IP "\fBversions\fR: returns \fIlist\fR of \fIstring\fR" 4
.IX Item "versions: returns list of string"
Returns a list of the \s-1SPF\s0 record versions that are used for request. See the
description of the \*(L"new\*(R" constructor's \f(CW\*(C`versions\*(C'\fR option.
.IP "\fBscope\fR: returns \fIstring\fR" 4
.IX Item "scope: returns string"
Returns the scope of the request. See the description of the \*(L"new\*(R"
constructor's \f(CW\*(C`scope\*(C'\fR option.
.IP "\fBauthority_domain\fR: returns \fIstring\fR" 4
.IX Item "authority_domain: returns string"
Returns the authority domain of the request. See the description of the
\&\*(L"new\*(R" constructor's \f(CW\*(C`authority_domain\*(C'\fR option.
.IP "\fBidentity\fR: returns \fIstring\fR" 4
.IX Item "identity: returns string"
Returns the identity of the request. See the description of the \*(L"new\*(R"
constructor's \f(CW\*(C`identity\*(C'\fR option.
.IP "\fBdomain\fR: returns \fIstring\fR" 4
.IX Item "domain: returns string"
Returns the identity domain of the request. See the description of the
\&\*(L"new\*(R" constructor's \f(CW\*(C`identity\*(C'\fR option.
.IP "\fBlocalpart\fR: returns \fIstring\fR" 4
.IX Item "localpart: returns string"
Returns the identity localpart of the request. See the description of the
\&\*(L"new\*(R" constructor's \f(CW\*(C`identity\*(C'\fR option.
.IP "\fBip_address\fR: returns \fINetAddr::IP\fR" 4
.IX Item "ip_address: returns NetAddr::IP"
Returns the \s-1IP\s0 address of the request as a \fINetAddr::IP\fR object. See the
description of the \*(L"new\*(R" constructor's \f(CW\*(C`ip_address\*(C'\fR option.
.IP "\fBip_address_v6\fR: returns \fINetAddr::IP\fR" 4
.IX Item "ip_address_v6: returns NetAddr::IP"
Like the \f(CW\*(C`ip_address\*(C'\fR method, however, an IPv4 address is returned as an
IPv4\-mapped IPv6 address (e.g. '::ffff:192.168.0.1') to facilitate uniform
processing.
.IP "\fBhelo_identity\fR: returns \fIstring\fR" 4
.IX Item "helo_identity: returns string"
Returns the \f(CW\*(C`HELO\*(C'\fR \s-1SMTP\s0 transaction parameter of the request. See the
description of the \*(L"new\*(R" constructor's \f(CW\*(C`helo_identity\*(C'\fR option.
.IP "\fBrecord\fR: returns \fIMail::SPF::Record\fR" 4
.IX Item "record: returns Mail::SPF::Record"
Returns the \s-1SPF\s0 record selected during the processing of the request, or
\&\fBundef\fR if there is none.
.IP "\fBstate($field)\fR: returns anything" 4
.IX Item "state($field): returns anything"
.PD 0
.ie n .IP "\fBstate($field, \fB$value\fB)\fR: returns anything" 4
.el .IP "\fBstate($field, \f(CB$value\fB)\fR: returns anything" 4
.IX Item "state($field, $value): returns anything"
.PD
Provides an interface for storing temporary state information with the request
object. This is primarily meant to be used internally by \fIMail::SPF::Server\fR
and other Mail::SPF classes.
.Sp
If \f(CW$value\fR is specified, stores it in a state field named \f(CW$field\fR. Returns
the current (new) value of the state field named \f(CW$field\fR. This method may be
used as an lvalue.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
Mail::SPF, Mail::SPF::Server
.PP
<http://tools.ietf.org/html/rfc4408>
.PP
For availability, support, and license information, see the \s-1README\s0 file
included with Mail::SPF.
.SH "AUTHORS"
.IX Header "AUTHORS"
Julian Mehnle <julian@mehnle.net>, Shevek <cpan@anarres.org>