line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyrights 2001-2022 by [Mark Overmeer ]. |
2
|
|
|
|
|
|
|
# For other contributors see ChangeLog. |
3
|
|
|
|
|
|
|
# See the manual pages for details on the licensing terms. |
4
|
|
|
|
|
|
|
# Pod stripped from pm file by OODoc 2.03. |
5
|
|
|
|
|
|
|
# This code is part of distribution Mail-Message. Meta-POD processed with |
6
|
|
|
|
|
|
|
# OODoc into POD and HTML manual-pages. See README.md |
7
|
|
|
|
|
|
|
# Copyright Mark Overmeer. Licensed under the same terms as Perl itself. |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
package Mail::Message::TransferEnc::Base64; |
10
|
5
|
|
|
5
|
|
1849
|
use vars '$VERSION'; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
258
|
|
11
|
|
|
|
|
|
|
$VERSION = '3.012'; |
12
|
|
|
|
|
|
|
|
13
|
5
|
|
|
5
|
|
28
|
use base 'Mail::Message::TransferEnc'; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
1375
|
|
14
|
|
|
|
|
|
|
|
15
|
5
|
|
|
5
|
|
39
|
use strict; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
83
|
|
16
|
5
|
|
|
5
|
|
22
|
use warnings; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
98
|
|
17
|
|
|
|
|
|
|
|
18
|
5
|
|
|
5
|
|
847
|
use MIME::Base64; |
|
5
|
|
|
|
|
1190
|
|
|
5
|
|
|
|
|
1327
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub name() { 'base64' } |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
#------------------------------------------ |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub check($@) |
26
|
0
|
|
|
0
|
1
|
0
|
{ my ($self, $body, %args) = @_; |
27
|
0
|
|
|
|
|
0
|
$body; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
#------------------------------------------ |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub decode($@) |
34
|
2
|
|
|
2
|
1
|
10
|
{ my ($self, $body, %args) = @_; |
35
|
|
|
|
|
|
|
|
36
|
2
|
|
|
|
|
7
|
my $lines = decode_base64($body->string); |
37
|
2
|
50
|
|
|
|
8
|
unless($lines) |
38
|
0
|
|
|
|
|
0
|
{ $body->transferEncoding('none'); |
39
|
0
|
|
|
|
|
0
|
return $body; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
my $bodytype |
43
|
|
|
|
|
|
|
= defined $args{result_type} ? $args{result_type} |
44
|
2
|
50
|
|
|
|
17
|
: $body->isBinary ? 'Mail::Message::Body::File' |
|
|
100
|
|
|
|
|
|
45
|
|
|
|
|
|
|
: ref $body; |
46
|
|
|
|
|
|
|
|
47
|
2
|
|
|
|
|
21
|
$bodytype->new |
48
|
|
|
|
|
|
|
( based_on => $body |
49
|
|
|
|
|
|
|
, transfer_encoding => 'none' |
50
|
|
|
|
|
|
|
, data => $lines |
51
|
|
|
|
|
|
|
); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
#------------------------------------------ |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub encode($@) |
57
|
4
|
|
|
4
|
1
|
716
|
{ my ($self, $body, %args) = @_; |
58
|
|
|
|
|
|
|
|
59
|
4
|
|
66
|
|
|
16
|
my $bodytype = $args{result_type} || ref $body; |
60
|
|
|
|
|
|
|
|
61
|
4
|
|
|
|
|
18
|
$bodytype->new |
62
|
|
|
|
|
|
|
( based_on => $body |
63
|
|
|
|
|
|
|
, checked => 1 |
64
|
|
|
|
|
|
|
, transfer_encoding => 'base64' |
65
|
|
|
|
|
|
|
, data => encode_base64($body->string) |
66
|
|
|
|
|
|
|
); |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
#------------------------------------------ |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
1; |