Mail::SPF::Mod (3)
Leading comments
Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) Standard preamble: ========================================================================
NAME
Mail::SPF::Mod - SPF record modifier base classDESCRIPTION
An object of class Mail::SPF::Mod represents a modifier within anConstructors
The following constructors are provided:- new(%options): returns Mail::SPF::Mod
-
Abstract. Creates a new SPFrecord modifier object.
%options is a list of key/value pairs representing any of the following options:
-
- text
- A string denoting the unparsed text of the modifier.
- name
- 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.
- domain_spec
- Either a plain string or a Mail::SPF::MacroString object denoting an optional "domain-spec" parameter of the mechanism.
-
- new_from_string($text, %options): returns Mail::SPF::Mod; throws Mail::SPF::ENothingToParse, Mail::SPF::EInvalidMod
-
Abstract. Creates a new SPFrecord modifier object by parsing the string and any options given.
Class methods
The following class methods are provided:- name_pattern: returns Regexp
- Returns a regular expression that matches any legal modifier name.
Instance methods
The following instance methods are provided:- text: 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.
- name: returns string
- Returns the name of the modifier.
- params: 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.
- stringify: 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''.
- process: 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 Mail::SPF::Mod module.Global modifiers - Mail::SPF::GlobalMod
SPFv1 (The following additional class method is provided by Mail::SPF::GlobalMod:
- precedence: returns real
-
Abstract. Returns a real number between 0 and 1 denoting the
precedence of the type of the global modifier. Global modifiers present in an
SPFrecord are processed in the order of their precedence values, 0 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 Mail::SPF::GlobalMod:
- process($server, $request, $result): 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 SPFresult has already been determined, takes also the current Mail::SPF::Result. If the modifier wishes to modify theSPFresult, 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
SenderA positional modifier may appear anywhere in an
The following specific instance method is provided by Mail::SPF::PositionalMod:
- process($server, $request): 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 SPFresult has been determined, no result object is available to the modifier. The modifier can (at least at this time) not directly modify the finalSPFresult, 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 SPFv1 and SenderAlso obviously, Mail::SPF::UnknownMod does not support a "process" method.
The following specific instance method is provided by Mail::SPF::UnknownMod:
- params: 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::ExpMail::SPF, Mail::SPF::Record, Mail::SPF::Term
For availability, support, and license information, see the