Message/Convert/MimeEntity.pm untested

filter: Statementstmt 0.0% 0 / 31 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 3 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 9 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 53 CC 5 SCAR 18.9
CC
5
Cov
0%
export
12.0
from
12.0
BEGIN
2.0
CRAP 6.6
1 # Copyrights 2001-2022 by [Mark Overmeer <markov@cpan.org>].
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::Convert::MimeEntity;
10 use vars '$VERSION';
11 $VERSION = '3.012';
12  
13 use base 'Mail::Message::Convert';
14  
15 use strict;
16 use warnings;
17  
18 use MIME::Entity;
19 use MIME::Parser;
20 use Mail::Message;
21  
22  
23 sub export($$;$)
24 { my ($self, $message, $parser) = @_;
25 return () unless defined $message;
26  
27 $self->log(ERROR =>
28 "Export message must be a Mail::Message, but is a ".ref($message)."."),
29 return
30 unless $message->isa('Mail::Message');
31  
32 $parser ||= MIME::Parser->new;
33 $parser->parse($message->file);
34 }
35  
36  
37 sub from($)
38 { my ($self, $mime_ent) = @_;
39 return () unless defined $mime_ent;
40  
41 $self->log(ERROR =>
42 'Converting from MIME::Entity but got a '.ref($mime_ent).'.'), return
43 unless $mime_ent->isa('MIME::Entity');
44  
45 Mail::Message->read($mime_ent->as_string);
46 }
47  
48 1;