SPF/Mech/All.pm

filter: Statementstmt 87.1% 27 / 31 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 8 / 10 Podpod 50.0% 1 / 2 totaltotal 83.7% 36 / 43 CC 1 SCAR 1.8
CC
1
Cov
87%
parse_params
2.0
match
2.0
BEGIN
1.0
CRAP 1.2
« SPF/Mech/PTR.pm ↑ Summary SPF.pm »
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.20250505
20  
21 =cut
22  
23 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
24 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
25  
26 1 ▶use base 'Mail::SPF::Mech';
Subroutine BEGIN: called CC=1 SCAR=0.0
27  
28 1 ▶use constant TRUE => (0 == 0);
Subroutine BEGIN: called CC=1 SCAR=0.0
29 1 ▶use constant FALSE => not TRUE;
Subroutine BEGIN: called CC=1 SCAR=0.0
30  
31 1 ▶use constant name => 'all';
Subroutine BEGIN: called CC=1 SCAR=0.0
32 1 ▶use constant name_pattern => qr/${\name}/i;
Subroutine BEGIN: called CC=1 SCAR=0.0
33  
34 use constant explanation_templates_by_result_code => {
35 1 %{__PACKAGE__->SUPER::explanation_templates_by_result_code},
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 ▶};
Subroutine BEGIN: called CC=1 SCAR=0.0
40  
41 =head1 DESCRIPTION
42  
43 An object of class B<Mail::SPF::Mech::All> represents an SPF record mechanism
44 of type C<all>.
45  
46 =head2 Constructors
47  
48 The following constructors are provided:
49  
50 =over
51  
52 =item B<new>: returns I<Mail::SPF::Mech::All>
53  
54 Creates a new SPF record C<all> 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<qualifier>
61  
62 See L<Mail::SPF::Mech/new>.
63  
64 =back
65  
66 =item B<new_from_string($text, %options)>: returns I<Mail::SPF::Mech::All>;
67 throws I<Mail::SPF::ENothingToParse>, I<Mail::SPF::EInvalidMech>
68  
69 Creates a new SPF record C<all> 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<default_qualifier>
81  
82 =item B<qualifier_pattern>
83  
84 See L<Mail::SPF::Mech/Class methods>.
85  
86 =item B<name>: returns I<string>
87  
88 Returns B<'all'>.
89  
90 =item B<name_pattern>: returns I<Regexp>
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 ▶ my ($self) = @_;
Subroutine parse_params: not called CC=1 SCAR=6.9
Pod undocumented
106 # No parameters.
107 0 return;
108 }
109  
110 =item B<text>
111  
112 =item B<qualifier>
113  
114 =item B<name>
115  
116 =item B<stringify>
117  
118 See L<Mail::SPF::Mech/Instance methods>.
119  
120 =item B<match($server, $request)>: returns I<boolean>
121  
122 Returns B<true> because the C<all> mechanism always matches. See RFC 4408,
123 5.1, for details.
124  
125 =cut
126  
127 sub match {
128 0 ▶ my ($self, $server, $request) = @_;
Subroutine match: not called CC=1 SCAR=6.9
Pod documented
129 0 return TRUE;
130 }
131  
132 =back
133  
134 =head1 SEE ALSO
135  
136 L<Mail::SPF>, L<Mail::SPF::Record>, L<Mail::SPF::Term>, L<Mail::SPF::Mech>
137  
138 L<http://tools.ietf.org/html/rfc4408>
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 <julian@mehnle.net>, Shevek <cpan@anarres.org>
146  
147 =cut
148  
149 1 TRUE;
« SPF/Mech/PTR.pm ↑ Summary SPF.pm »