File Coverage

blib/lib/Mail/SPF/Mech/All.pm
Criterion Covered Total %
statement 26 30 86.6
branch n/a
condition n/a
subroutine 8 10 80.0
pod 1 2 50.0
total 35 42 83.3


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