line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyrights 2001-2023 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; |
10
|
13
|
|
|
13
|
|
107
|
use vars '$VERSION'; |
|
13
|
|
|
|
|
25
|
|
|
13
|
|
|
|
|
748
|
|
11
|
|
|
|
|
|
|
$VERSION = '3.013'; |
12
|
|
|
|
|
|
|
|
13
|
13
|
|
|
13
|
|
76
|
use base 'Mail::Reporter'; |
|
13
|
|
|
|
|
30
|
|
|
13
|
|
|
|
|
1517
|
|
14
|
|
|
|
|
|
|
|
15
|
13
|
|
|
13
|
|
85
|
use strict; |
|
13
|
|
|
|
|
38
|
|
|
13
|
|
|
|
|
285
|
|
16
|
13
|
|
|
13
|
|
63
|
use warnings; |
|
13
|
|
|
|
|
27
|
|
|
13
|
|
|
|
|
4089
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
my %encoder = |
20
|
|
|
|
|
|
|
( base64 => 'Mail::Message::TransferEnc::Base64' |
21
|
|
|
|
|
|
|
, '7bit' => 'Mail::Message::TransferEnc::SevenBit' |
22
|
|
|
|
|
|
|
, '8bit' => 'Mail::Message::TransferEnc::EightBit' |
23
|
|
|
|
|
|
|
, 'quoted-printable' => 'Mail::Message::TransferEnc::QuotedPrint' |
24
|
|
|
|
|
|
|
); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
#------------------------------------------ |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub create($@) |
30
|
0
|
|
|
0
|
1
|
|
{ my ($class, $type) = (shift, shift); |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
my $encoder = $encoder{lc $type}; |
33
|
0
|
0
|
|
|
|
|
unless($encoder) |
34
|
0
|
|
|
|
|
|
{ $class->new(@_)->log(WARNING => "No decoder for transfer encoding $type."); |
35
|
0
|
|
|
|
|
|
return; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
eval "require $encoder"; |
39
|
0
|
0
|
|
|
|
|
if($@) |
40
|
0
|
|
|
|
|
|
{ $class->new(@_)->log(ERROR => |
41
|
|
|
|
|
|
|
"Decoder for transfer encoding $type does not work:\n$@"); |
42
|
0
|
|
|
|
|
|
return; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
0
|
|
|
|
|
|
$encoder->new(@_); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub addTransferEncoder($$) |
50
|
0
|
|
|
0
|
1
|
|
{ my ($class, $type, $encoderclass) = @_; |
51
|
0
|
|
|
|
|
|
$encoder{lc $type} = $encoderclass; |
52
|
0
|
|
|
|
|
|
$class; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
0
|
|
|
0
|
1
|
|
sub name {shift->notImplemented} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
#------------------------------------------ |
59
|
|
|
|
|
|
|
|
60
|
0
|
|
|
0
|
1
|
|
sub check($@) {shift->notImplemented} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
0
|
|
|
0
|
1
|
|
sub decode($@) {shift->notImplemented} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
|
66
|
0
|
|
|
0
|
1
|
|
sub encode($) {shift->notImplemented} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
#------------------------------------------ |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
1; |