| 1 | # | ||
| 2 | # Mail::SPF::Mech::All | ||
| 3 | # SPF record "all" mechanism class. | ||
| 4 | # | ||
| 5 | # (C) 2005-2012 Julian Mehnle <julian@mehnle.net> | ||
| 6 | # 2005 Shevek <cpan@anarres.org> | ||
| 7 | # $Id: All.pm 57 2012-01-30 08:15:31Z julian $ | ||
| 8 | # | ||
| 9 | ############################################################################## | ||
| 10 | |||
| 11 | package Mail::SPF::Mech::All; | ||
| 12 | |||
| 13 | =head1 NAME | ||
| 14 | |||
| 15 | Mail::SPF::Mech::All - SPF record C<all> mechanism class | ||
| 16 | |||
| 17 | =head1 VERSION | ||
| 18 | |||
| 19 | version 3.20261105 | ||
| 20 | |||
| 21 | =cut | ||
| 22 | |||
| 23 | 5 | our $VERSION = '3.20261105'; # VERSION | |
| 24 | |||
| 25 | 5 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 26 | 5 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 27 | |||
| 28 | 5 | ▶ | use base 'Mail::SPF::Mech'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 29 | |||
| 30 | 5 | ▶ | use constant TRUE => (0 == 0); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 31 | 5 | ▶ | use constant FALSE => not TRUE; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 32 | |||
| 33 | 5 | ▶ | use constant name => 'all'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 34 | 5 | ▶ | use constant name_pattern => qr/${\name}/i; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 35 | |||
| 36 | 5 | ▶ | use constant explanation_templates_by_result_code => { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 37 | 5 | %{__PACKAGE__->SUPER::explanation_templates_by_result_code}, | |
| 38 | pass => "Sender is authorized by default to use '%{s}' in '%{_scope}' identity", | ||
| 39 | fail => "Sender is not authorized by default to use '%{s}' in '%{_scope}' identity", | ||
| 40 | softfail => "Sender is not authorized by default to use '%{s}' in '%{_scope}' identity, however domain is not currently prepared for false failures", | ||
| 41 | 5 | }; | |
| 42 | |||
| 43 | =head1 DESCRIPTION | ||
| 44 | |||
| 45 | An object of class B<Mail::SPF::Mech::All> represents an SPF record mechanism | ||
| 46 | of type C<all>. | ||
| 47 | |||
| 48 | =head2 Constructors | ||
| 49 | |||
| 50 | The following constructors are provided: | ||
| 51 | |||
| 52 | =over | ||
| 53 | |||
| 54 | =item B<new>: returns I<Mail::SPF::Mech::All> | ||
| 55 | |||
| 56 | Creates a new SPF record C<all> mechanism object. | ||
| 57 | |||
| 58 | %options is a list of key/value pairs representing any of the following options: | ||
| 59 | |||
| 60 | =over | ||
| 61 | |||
| 62 | =item B<qualifier> | ||
| 63 | |||
| 64 | See L<Mail::SPF::Mech/new>. | ||
| 65 | |||
| 66 | =back | ||
| 67 | |||
| 68 | =item B<new_from_string($text, %options)>: returns I<Mail::SPF::Mech::All>; | ||
| 69 | throws I<Mail::SPF::ENothingToParse>, I<Mail::SPF::EInvalidMech> | ||
| 70 | |||
| 71 | Creates a new SPF record C<all> mechanism object by parsing the string and | ||
| 72 | any options given. | ||
| 73 | |||
| 74 | =back | ||
| 75 | |||
| 76 | =head2 Class methods | ||
| 77 | |||
| 78 | The following class methods are provided: | ||
| 79 | |||
| 80 | =over | ||
| 81 | |||
| 82 | =item B<default_qualifier> | ||
| 83 | |||
| 84 | =item B<qualifier_pattern> | ||
| 85 | |||
| 86 | See L<Mail::SPF::Mech/Class methods>. | ||
| 87 | |||
| 88 | =item B<name>: returns I<string> | ||
| 89 | |||
| 90 | Returns B<'all'>. | ||
| 91 | |||
| 92 | =item B<name_pattern>: returns I<Regexp> | ||
| 93 | |||
| 94 | Returns a regular expression that matches a mechanism name of B<'all'>. | ||
| 95 | |||
| 96 | =back | ||
| 97 | |||
| 98 | =head2 Instance methods | ||
| 99 | |||
| 100 | The following instance methods are provided: | ||
| 101 | |||
| 102 | =over | ||
| 103 | |||
| 104 | =cut | ||
| 105 | |||
| 106 | 32 | ▶ | sub parse_params { |
|
Subroutine
parse_params: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 107 | 32 | my ($self) = @_; | |
| 108 | # No parameters. | ||
| 109 | 32 | return; | |
| 110 | } | ||
| 111 | |||
| 112 | =item B<text> | ||
| 113 | |||
| 114 | =item B<qualifier> | ||
| 115 | |||
| 116 | =item B<name> | ||
| 117 | |||
| 118 | =item B<stringify> | ||
| 119 | |||
| 120 | See L<Mail::SPF::Mech/Instance methods>. | ||
| 121 | |||
| 122 | =item B<match($server, $request)>: returns I<boolean> | ||
| 123 | |||
| 124 | Returns B<true> because the C<all> mechanism always matches. See RFC 4408, | ||
| 125 | 5.1, for details. | ||
| 126 | |||
| 127 | =cut | ||
| 128 | |||
| 129 | 20 | ▶ | sub match { |
|
Subroutine
match: called CC=1 SCAR=0.0
Pod
documented
| |||
| 130 | 20 | my ($self, $server, $request) = @_; | |
| 131 | 20 | return TRUE; | |
| 132 | } | ||
| 133 | |||
| 134 | =back | ||
| 135 | |||
| 136 | =head1 SEE ALSO | ||
| 137 | |||
| 138 | L<Mail::SPF>, L<Mail::SPF::Record>, L<Mail::SPF::Term>, L<Mail::SPF::Mech> | ||
| 139 | |||
| 140 | L<http://tools.ietf.org/html/rfc4408> | ||
| 141 | |||
| 142 | For availability, support, and license information, see the README file | ||
| 143 | included with Mail::SPF. | ||
| 144 | |||
| 145 | =head1 AUTHORS | ||
| 146 | |||
| 147 | Julian Mehnle <julian@mehnle.net>, Shevek <cpan@anarres.org> | ||
| 148 | |||
| 149 | =cut | ||
| 150 | |||
| 151 | 5 | TRUE; | |