line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mail::BIMI::Options; |
2
|
|
|
|
|
|
|
# ABSTRACT: Shared options |
3
|
|
|
|
|
|
|
our $VERSION = '3.20210225'; # VERSION |
4
|
30
|
|
|
30
|
|
518
|
use 5.20.0; |
|
30
|
|
|
|
|
103
|
|
5
|
30
|
|
|
30
|
|
167
|
use Moose; |
|
30
|
|
|
|
|
55
|
|
|
30
|
|
|
|
|
195
|
|
6
|
30
|
|
|
30
|
|
197942
|
use Mail::BIMI::Prelude; |
|
30
|
|
|
|
|
72
|
|
|
30
|
|
|
|
|
222
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
has cache_backend => ( is => 'rw', lazy => 1, default => sub {return $ENV{MAIL_BIMI_CACHE_BACKEND}//$ENV{MAIL_BIMI_CACHE_DEFAULT_BACKEND}//'File'}, |
10
|
|
|
|
|
|
|
documentation => 'Cache backend to use for cacheing' ); |
11
|
|
|
|
|
|
|
has cache_fastmmap_share_file => ( is => 'rw', lazy => 1, default => sub {return $ENV{MAIL_BIMI_CACHE_FASTMMAP_SHARE_FILE}//'/tmp/mail-bimi.fastmmap'}, |
12
|
|
|
|
|
|
|
documentation => 'Shared cache file when using FastMmap backend' ); |
13
|
|
|
|
|
|
|
has cache_file_directory => ( is => 'rw', lazy => 1, default => sub {return $ENV{MAIL_BIMI_CACHE_FILE_DIRECTORY}//'/tmp/'}, |
14
|
|
|
|
|
|
|
documentation => 'Directory to store Cache files in when using File backend' ); |
15
|
|
|
|
|
|
|
has force_record => ( is => 'rw', lazy => 1, default => sub {return $ENV{MAIL_BIMI_FORCE_RECORD}}, |
16
|
|
|
|
|
|
|
documentation => 'Fake record to use' ); |
17
|
|
|
|
|
|
|
has http_client_timeout => ( is => 'rw', lazy => 1, default => sub {return $ENV{MAIL_BIMI_HTTP_CLIENT_TIMEOUT}//3}, |
18
|
|
|
|
|
|
|
documentation => 'Timeout value for HTTP' ); |
19
|
|
|
|
|
|
|
has http_client_max_redirect => ( is => 'rw', lazy => 1, default => sub {return $ENV{MAIL_BIMI_HTTP_CLIENT_MAX_REDIRECT}//3}, |
20
|
|
|
|
|
|
|
documentation => 'Maximum redirects to follow for HTTP' ); |
21
|
|
|
|
|
|
|
has dns_client_timeout => ( is => 'rw', lazy => 1, default => sub {return $ENV{MAIL_BIMI_DNS_CLIENT_TIMEOUT}//5}, |
22
|
|
|
|
|
|
|
documentation => 'Timeout value for DNS' ); |
23
|
|
|
|
|
|
|
has no_location_with_vmc => ( is => 'rw', lazy => 1, default => sub {return $ENV{MAIL_BIMI_NO_LOCATION_WITH_VMC}}, |
24
|
|
|
|
|
|
|
documentation => 'Do not check location if VMC was present' ); |
25
|
|
|
|
|
|
|
has cert_subdomain_is_valid => ( is => 'rw', lazy => 1, default => sub {return $ENV{MAIL_BIMI_CERT_SUBDOMAIN_IS_VALID}//0}, |
26
|
|
|
|
|
|
|
documentation => 'Should VMCs be valid for any subdomain of their altname' ); |
27
|
|
|
|
|
|
|
has no_validate_cert => ( is => 'rw', lazy => 1, default => sub {return $ENV{MAIL_BIMI_NO_VALIDATE_CERT}}, |
28
|
|
|
|
|
|
|
documentation => 'Do not validate VMC' ); |
29
|
|
|
|
|
|
|
has no_validate_svg => ( is => 'rw', lazy => 1, default => sub {return $ENV{MAIL_BIMI_NO_VALIDATE_SVG}}, |
30
|
|
|
|
|
|
|
documentation => 'Do not validate SVG' ); |
31
|
|
|
|
|
|
|
has require_vmc => ( is => 'rw', lazy => 1, default => sub {return $ENV{MAIL_BIMI_REQUIRE_VMC}}, |
32
|
|
|
|
|
|
|
documentation => 'Require VMC validation' ); |
33
|
|
|
|
|
|
|
has ssl_root_cert => ( is => 'rw', lazy => 1, default => sub {return $ENV{MAIL_BIMI_SSL_ROOT_CERT}//undef}, |
34
|
|
|
|
|
|
|
documentation => 'Location of SSL Root Cert Bundle - Defaults to Mozilla::CA bundle plus Known BIMI Root Certs' ); |
35
|
|
|
|
|
|
|
has strict_spf => ( is => 'rw', lazy => 1, default => sub {return $ENV{MAIL_BIMI_STRICT_SPF}}, |
36
|
|
|
|
|
|
|
documentation => 'Disallow SPF +all' ); |
37
|
|
|
|
|
|
|
has svg_from_file => ( is => 'rw', lazy => 1, default => sub {return $ENV{MAIL_BIMI_SVG_FROM_FILE}}, |
38
|
|
|
|
|
|
|
documentation => 'Fake SVG with file contents' ); |
39
|
|
|
|
|
|
|
has svg_max_fetch_size => ( is => 'rw', lazy => 1, default => sub {return $ENV{MAIL_BIMI_SVG_MAX_FETCH_SIZE}//65535}, |
40
|
|
|
|
|
|
|
documentation => 'Maximum fetch size for SVG retrieval' ); |
41
|
|
|
|
|
|
|
has svg_max_size => ( is => 'rw', lazy => 1, default => sub {return $ENV{MAIL_BIMI_SVG_MAX_SIZE}//32768}, |
42
|
|
|
|
|
|
|
documentation => 'Maximum valid size for SVG' ); |
43
|
|
|
|
|
|
|
has svg_profile => ( is => 'rw', lazy => 1, default => sub {return $ENV{MAIL_BIMI_SVG_PROFILE}//'SVG_1.2_PS'}, |
44
|
|
|
|
|
|
|
documentation => 'Profile name to use for SVG validation' ); |
45
|
|
|
|
|
|
|
has verbose => ( is => 'rw', lazy => 1, default => sub {return $ENV{MAIL_BIMI_VERBOSE}}, |
46
|
|
|
|
|
|
|
documentation => 'Be More Verbose' ); |
47
|
|
|
|
|
|
|
has vmc_from_file => ( is => 'rw', lazy => 1, default => sub {return $ENV{MAIL_BIMI_VMC_FROM_FILE}}, |
48
|
|
|
|
|
|
|
documentation => 'Fake VMC with file contents' ); |
49
|
|
|
|
|
|
|
has vmc_no_check_alt => ( is => 'rw', lazy => 1, default => sub {return $ENV{MAIL_BIMI_VMC_NO_CHECK_ALT}}, |
50
|
|
|
|
|
|
|
documentation => 'Do not check the alt name of a VMC' ); |
51
|
|
|
|
|
|
|
has vmc_max_fetch_size => ( is => 'rw', lazy => 1, default => sub {return $ENV{MAIL_BIMI_VMC_MAX_FETCH_SIZE}//65535}, |
52
|
|
|
|
|
|
|
documentation => 'Maximum fetch size for VMC retrieval' ); |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
__END__ |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=pod |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=encoding UTF-8 |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 NAME |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Mail::BIMI::Options - Shared options |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 VERSION |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
version 3.20210225 |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 DESCRIPTION |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Class for capturing caller options, which may be passed to the constructor, or set in environment |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
These values are derived from lookups and verifications made based upon the input values, it is however possible to override these with other values should you wish to, for example, validate a record before it is published in DNS, or validate an Indicator which is only available locally |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head2 cache_backend |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
is=rw |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
Cache backend to use for cacheing |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head2 cache_fastmmap_share_file |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
is=rw |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Shared cache file when using FastMmap backend |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head2 cache_file_directory |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
is=rw |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
Directory to store Cache files in when using File backend |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=head2 cert_subdomain_is_valid |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
is=rw |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
Should VMCs be valid for any subdomain of their altname |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head2 dns_client_timeout |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
is=rw |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
Timeout value for DNS |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=head2 force_record |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
is=rw |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
Fake record to use |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head2 http_client_max_redirect |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
is=rw |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
Maximum redirects to follow for HTTP |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=head2 http_client_timeout |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
is=rw |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
Timeout value for HTTP |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=head2 no_location_with_vmc |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
is=rw |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
Do not check location if VMC was present |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=head2 no_validate_cert |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
is=rw |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
Do not validate VMC |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=head2 no_validate_svg |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
is=rw |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
Do not validate SVG |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
=head2 require_vmc |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
is=rw |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
Require VMC validation |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=head2 ssl_root_cert |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
is=rw |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
Location of SSL Root Cert Bundle - Defaults to Mozilla::CA bundle plus Known BIMI Root Certs |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
=head2 strict_spf |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
is=rw |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
Disallow SPF +all |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
=head2 svg_from_file |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
is=rw |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
Fake SVG with file contents |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
=head2 svg_max_fetch_size |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
is=rw |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
Maximum fetch size for SVG retrieval |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
=head2 svg_max_size |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
is=rw |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
Maximum valid size for SVG |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
=head2 svg_profile |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
is=rw |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
Profile name to use for SVG validation |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
=head2 verbose |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
is=rw |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
Be More Verbose |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
=head2 vmc_from_file |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
is=rw |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
Fake VMC with file contents |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
=head2 vmc_max_fetch_size |
199
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
is=rw |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
Maximum fetch size for VMC retrieval |
203
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
=head2 vmc_no_check_alt |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
is=rw |
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
Do not check the alt name of a VMC |
209
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
=head1 EXTENDS |
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
=over 4 |
213
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
=item * L<Moose::Object> |
215
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
=back |
217
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
=head1 REQUIRES |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
=over 4 |
221
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
=item * L<Mail::BIMI::Prelude|Mail::BIMI::Prelude> |
223
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
=item * L<Moose|Moose> |
225
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
=back |
227
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
=head1 AUTHOR |
229
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
Marc Bradshaw <marc@marcbradshaw.net> |
231
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
233
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
This software is copyright (c) 2020 by Marc Bradshaw. |
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
237
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
238
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
=cut |