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::MOD (3)

.ds Aq ’

NAME

Mail::SPF::Mod - SPF record modifier base class

CONTENTS

DESCRIPTION

An object of class <B>Mail::SPF::ModB> represents a modifier within an SPF record. Mail::SPF::Mod cannot be instantiated directly. Create an instance of a concrete sub-class instead.

    Constructors

The following constructors are provided:
<B>new(%options)B>: returns Mail::SPF::Mod Abstract. Creates a new SPF record modifier object.

%options is a list of key/value pairs representing any of the following options:
<B>textB> A string denoting the unparsed text of the modifier.
<B>nameB> A string denoting the name of the modifier. Required if a generic Mail::SPF::Mod object (as opposed to a specific sub-class) is being constructed.
<B>domain_specB> Either a plain string or a Mail::SPF::MacroString object denoting an optional domain-spec parameter of the mechanism.

<B>new_from_string($text, B>%options<B>)B>: returns Mail::SPF::Mod; throws Mail::SPF::ENothingToParse, Mail::SPF::EInvalidMod Abstract. Creates a new SPF record modifier object by parsing the string and any options given.

    Class methods

The following class methods are provided:
<B>name_patternB>: returns Regexp Returns a regular expression that matches any legal modifier name.

    Instance methods

The following instance methods are provided:
<B>textB>: returns string; throws Mail::SPF::ENoUnparsedText Returns the unparsed text of the modifier. Throws a Mail::SPF::ENoUnparsedText exception if the modifier was created synthetically instead of being parsed, and no text was provided.
<B>nameB>: returns string Returns the name of the modifier.
<B>paramsB>: returns string Abstract. Returns the modifier’s parameters formatted as a string.

A sub-class of Mail::SPF::Mod does not have to implement this method if it supports no parameters, although this is highly unlikely.

<B>stringifyB>: returns string Formats the modifier’s name and parameters as a string and returns it. You can simply use a Mail::SPF::Mod object as a string for the same effect, see OVERLOADING.
<B>processB>: throws Mail::SPF::Result, Mail::SPF::Result::Error, Mail::SPF::Exception Abstract. Processes the modifier. What that means depends on the actual implementation in sub-classes. See MODIFIER TYPES below.

This method is abstract and must be implemented by sub-classes of Mail::SPF::Mod.

MODIFIER TYPES

There are different basic types of modifiers, which are described below. All of them are provided by the <B>Mail::SPF::ModB> module.

Global modifiers - Mail::SPF::GlobalMod

<B>SPFv1B> (RFC 4408) only knows global modifiers. A global modifier may appear anywhere in an SPF record, but only once. During evaluation of the record, global modifiers are processed after the last mechanism has been evaluated and an SPF result has been determined.

The following additional class method is provided by <B>Mail::SPF::GlobalModB>:
<B>precedenceB>: returns real Abstract. Returns a real number between <B>0B> and <B>1B> denoting the precedence of the type of the global modifier. Global modifiers present in an SPF record are processed in the order of their precedence values, <B>0B> meaning first.

This method is abstract and must be implemented by sub-classes of Mail::SPF::GlobalMod.

The following specific instance method is provided by <B>Mail::SPF::GlobalModB>:
<B>process($server, B>$request<B>, B>$result<B>)B>: throws Mail::SPF::Result Abstract. Processes the modifier. What that means depends on the actual implementation in sub-classes. Takes both a Mail::SPF::Server and a Mail::SPF::Request object. As global modifiers are generally processed after an SPF result has already been determined, takes also the current Mail::SPF::Result. If the modifier wishes to modify the SPF result, it may throw a different Mail::SPF::Result object.

This method is abstract and must be implemented by sub-classes of Mail::SPF::GlobalMod.

Positional modifiers - Mail::SPF::PositionalMod

<B>Sender IDB> (RFC 4406) introduces the concept of positional modifiers. According to RFC 4406, a positional modifier must follow a mechanism and applies to that, and only that, mechanism. However, because this definition is not very useful, and because no positional modifiers have been defined based on it as of yet, <B>Mail::SPFB> deviates from RFC 4406 as follows:

A positional modifier may appear anywhere in an SPF record, and it is stateful, i.e. it applies to all mechanisms and modifiers that follow it. Positional modifiers are generally multiple, i.e. they may appear any number of times throughout the record. During evaluation of the record, positional modifiers are processed at exactly the time when they are encountered by the evaluator. Consequently, all positional modifiers are processed before an SPF result is determined.

The following specific instance method is provided by <B>Mail::SPF::PositionalModB>:
<B>process($server, B>$request<B>)B>: throws Mail::SPF::Result::Error, Mail::SPF::Exception Abstract. Processes the modifier. What that means depends on the actual implementation in sub-classes. Takes both a Mail::SPF::Server and a Mail::SPF::Request object. As global modifiers are generally processed before an SPF result has been determined, no result object is available to the modifier. The modifier can (at least at this time) not directly modify the final SPF result, however it may throw an exception to signal an error condition.

This method is abstract and must be implemented by sub-classes of Mail::SPF::PositionalMod.

Unknown modifiers - Mail::SPF::UnknownMod

Both <B>SPFv1B> and <B>Sender IDB> allow unknown modifiers to appear in SPF records in order to allow new modifiers to be introduced without breaking existing implementations. Obviously, unknown modifiers are neither global nor positional, but they may appear any number of times throughout the record and are simply ignored during evaluation of the record.

Also obviously, <B>Mail::SPF::UnknownModB> does not support a process method.

The following specific instance method is provided by <B>Mail::SPF::UnknownModB>:
<B>paramsB>: returns string Returns the modifier’s unparsed value as a string.

OVERLOADING

If a Mail::SPF::Mod object is used as a string, the stringify method is used to convert the object into a string.

SEE ALSO

Mail::SPF::Mod::Redirect, Mail::SPF::Mod::Exp

Mail::SPF, Mail::SPF::Record, Mail::SPF::Term

<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::MOD (3) 2016-04-03

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