Message/Replace/MailInternet.pm

filter: Statementstmt 16.3% 30 / 183 Branchbran 0.0% 0 / 70 Conditioncond 0.0% 0 / 70 MC/DCmcdc 0.0% 0 / 40 Subroutinesub 21.7% 10 / 46 Podpod 94.2% 33 / 35 totaltotal 16.4% 73 / 444 CC 64 SCAR 39.4
CC
64
Cov
9%
processRawData
156.0
reply
132.0
smtpsend
90.0
CRAP 51.5
« Message/Body.pm ↑ Summary Message/Body/Encode.pm »
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::Replace::MailInternet;
10 1 ▶use vars '$VERSION';
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 $VERSION = '3.012';
12  
13 1 ▶use base 'Mail::Message';
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 1 ▶use Mail::Box::FastScalar;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶use Mail::Box::Parser::Perl;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 1 ▶use Mail::Message::Body::Lines;
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 1 ▶use File::Spec;
Subroutine BEGIN: called CC=1 SCAR=0.0
23  
24  
25 sub new(@)
26 0 ▶{ my $class = shift;
Subroutine new: not called CC=3 SCAR=24.8
Pod documented
27 0 ▶ my $data = @_ % 2 ? shift : undef;
Branch: 1 branch
BranchTrueFalseTotal
@_ % 2 ? : 0 0 0
28 0 ▶ $class = __PACKAGE__ if $class eq 'Mail::Internet';
Branch: 1 branch
BranchTrueFalseTotal
if $class eq "Mail::Internet" 0 0 0
29 0 $class->SUPER::new(@_, raw_data => $data);
30 }
31  
32 sub init($)
33 0 ▶{ my ($self, $args) = @_;
Subroutine init: not called CC=8 SCAR=42.8
Pod undocumented
34 0 ▶ $args->{head_type} ||= 'Mail::Message::Replace::MailHeader';
Condition0%0/2
$args->{"head_type"} ||= "Mail::Message::Replace::MailHeader"
l!l
00
MC/DC0%0/1
$args->{"head_type"} ||= "Mail::Message::Replace::MailHeader"
$args->{"head_type"}
Truth table0%0/2
A
A= $args->{"head_type"}
Aresult
11
00
35 0 ▶ $args->{head} ||= $args->{Header};
Condition0%0/3
$args->{"head"} ||= $args->{"Header"}
l!l&&r!l&&!r
000
MC/DC0%0/2
$args->{"head"} ||= $args->{"Header"}
$args->{"head"} $args->{"Header"}
Truth table0%0/3
A ||= B
A= $args->{"head"}B= $args->{"Header"}
ABresult
1X1
011
000
36 0 ▶ $args->{body} ||= $args->{Body};
Condition0%0/3
$args->{"body"} ||= $args->{"Body"}
l!l&&r!l&&!r
000
MC/DC0%0/2
$args->{"body"} ||= $args->{"Body"}
$args->{"body"} $args->{"Body"}
Truth table0%0/3
A ||= B
A= $args->{"body"}B= $args->{"Body"}
ABresult
1X1
011
000
37  
38 0 ▶ defined $self->SUPER::init($args) or return;
Branch: 1 branch
BranchTrueFalseTotal
defined $self->SUPER::init($args) or return 0 0 0
39  
40 0 ▶ $self->{MI_wrap} = $args->{FoldLength} || 79;
Condition0%0/2
$args->{'FoldLength'} || 79
l!l
00
MC/DC0%0/1
$args->{'FoldLength'} || 79
$args->{'FoldLength'}
Truth table0%0/2
A
A= $args->{'FoldLength'}
Aresult
11
00
41 0 $self->{MI_mail_from} = $args->{MailFrom};
42 0 ▶ $self->{MI_modify} = exists $args->{Modify} ? $args->{Modify} : 1;
Branch: 1 branch
BranchTrueFalseTotal
exists $args->{'Modify'} ? : 0 0 0
43  
44 $self->processRawData($self->{raw_data}, !defined $args->{Header}
45 0 ▶ , !defined $args->{Body}) if defined $self->{raw_data};
Branch: 1 branch
BranchTrueFalseTotal
if defined $self->{"raw_data"} 0 0 0
46  
47 0 $self;
48 }
49  
50 sub processRawData($$$)
51 0 ▶{ my ($self, $data, $get_head, $get_body) = @_;
Subroutine processRawData: not called CC=12 SCAR=50.5
Pod undocumented
52 0 ▶ return $self unless $get_head || $get_body;
Branch: 1 branch
BranchTrueFalseTotal
unless $get_head or $get_body 0 0 0
Condition0%0/3
$get_head or $get_body
l!l&&r!l&&!r
000
MC/DC0%0/2
$get_head or $get_body
$get_head $get_body
Truth table0%0/3
A or B
A= $get_headB= $get_body
ABresult
1X1
011
000
53
54 0 my ($filename, $lines);
55 0 ▶ if(ref $data eq 'ARRAY')
Branch: 3 branches
BranchTrueFalseTotal
if (ref $data eq 'ARRAY') { } 0 0 0
elsif (ref $data eq 'GLOB') { } 0 0 0
elsif (ref $data and $data->isa('IO::Handle')) { } 0 0 0
56 0 { $filename = 'array of lines';
57 0 $lines = $data;
58 }
59 elsif(ref $data eq 'GLOB')
60 0 { $filename = 'file (GLOB)';
61 0 $lines = [ <$data> ];
62 }
63 ▶ elsif(ref $data && $data->isa('IO::Handle'))
Condition0%0/3
ref $data and $data->isa("IO::Handle")
!ll&&!rl&&r
000
MC/DC0%0/2
ref $data and $data->isa("IO::Handle")
ref $data $data->isa("IO::Handle")
Truth table0%0/3
A and B
A= ref $dataB= $data->isa("IO::Handle")
ABresult
0X0
100
111
64 0 { $filename = 'file ('.ref($data).')';
65 0 $lines = [ $data->getlines ];
66 }
67 else
68 0 { $self->log(ERROR=> "Mail::Internet does not support this kind of data");
69 0 return undef;
70 }
71  
72 0 ▶ return unless @$lines;
Branch: 1 branch
BranchTrueFalseTotal
unless @$lines 0 0 0
73  
74 0 my $buffer = join '', @$lines;
75 0 my $file = Mail::Box::FastScalar->new(\$buffer);
76  
77 0 my $parser = Mail::Box::Parser::Perl->new
78 ( filename => $filename
79 , file => $file
80 , trusted => 1
81 );
82  
83 0 my $head;
84 0 ▶ if($get_head)
Branch: 1 branch
BranchTrueFalseTotal
if ($get_head) { } 0 0 0
85 0 ▶ { my $from = substr($lines->[0], 0, 5) eq 'From ' ? shift @$lines : undef;
Branch: 1 branch
BranchTrueFalseTotal
substr($lines->[0], 0, 5) eq 'From ' ? : 0 0 0
86  
87 my $head = $self->{MM_head_type}->new
88 ( MailFrom => $self->{MI_mail_from}
89 , Modify => $self->{MI_modify}
90 , FoldLength => $self->{MI_wrap}
91 0 );
92 0 $head->read($parser);
93 0 ▶ $head->mail_from($from) if defined $from;
Branch: 1 branch
BranchTrueFalseTotal
if defined $from 0 0 0
94 0 $self->head($head);
95 }
96 else
97 0 { $head = $self->head;
98 }
99  
100 0 ▶ $self->storeBody($self->readBody($parser, $head)) if $get_body;
Branch: 1 branch
BranchTrueFalseTotal
if $get_body 0 0 0
101 0 $self->addReport($parser);
102 0 $parser->stop;
103 0 $self;
104 }
105  
106  
107 sub dup()
108 0 ▶{ my $self = shift;
Subroutine dup: not called CC=1 SCAR=6.9
Pod documented
109 0 ref($self)->coerce($self->clone);
110 }
111  
112  
113 0 ▶sub empty() { shift->DESTROY }
Subroutine empty: not called CC=1 SCAR=6.9
Pod documented
114  
115 #--------------------------
116  
117  
118 sub MailFrom(;$)
119 0 ▶{ my $self = shift;
Subroutine MailFrom: not called CC=2 SCAR=17.9
Pod documented
120 0 ▶ @_ ? ($self->{MI_mail_from} = shift) : $self->{MU_mail_from};
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 0 0 0
121 }
122  
123 #--------------------------
124  
125  
126 sub read($@)
127 0 ▶{ my $thing = shift;
Subroutine read: not called CC=2 SCAR=17.9
Pod documented
128  
129 0 ▶ return $thing->SUPER::read(@_) # Mail::Message behavior
Branch: 1 branch
BranchTrueFalseTotal
unless ref $thing 0 0 0
130 unless ref $thing;
131  
132 # Mail::Header emulation
133 0 my $data = shift;
134 0 $thing->processRawData($data, 1, 1);
135 }
136  
137  
138 sub read_body($)
139 0 ▶{ my ($self, $data) = @_;
Subroutine read_body: not called CC=1 SCAR=6.9
Pod documented
140 0 $self->processRawData($data, 0, 1);
141 }
142  
143  
144 sub read_header($)
145 0 ▶{ my ($self, $data) = @_;
Subroutine read_header: not called CC=1 SCAR=6.9
Pod documented
146 0 $self->processRawData($data, 1, 0);
147 }
148  
149  
150 sub extract($)
151 0 ▶{ my ($self, $data) = @_;
Subroutine extract: not called CC=1 SCAR=6.9
Pod documented
152 0 $self->processRawData($data, 1, 1);
153 }
154  
155  
156 sub reply(@)
157 0 ▶{ my ($self, %args) = @_;
Subroutine reply: not called CC=11 SCAR=48.8
Pod documented
158  
159 0 my $reply_head = $self->{MM_head_type}->new;
160 0 ▶ my $home = $ENV{HOME} || File::Spec->curdir;
Condition0%0/3
$ENV{'HOME'} || 'File::Spec'->curdir
l!l&&r!l&&!r
000
MC/DC0%0/2
$ENV{'HOME'} || 'File::Spec'->curdir
$ENV{'HOME'} 'File::Spec'->curdir
Truth table0%0/3
A || B
A= $ENV{'HOME'}B= 'File::Spec'->curdir
ABresult
1X1
011
000
161 0 my $headtemp = File::Spec->catfile($home, '.mailhdr');
162  
163 0 ▶ if(open HEAD, '<:raw', $headtemp)
Branch: 1 branch
BranchTrueFalseTotal
if (open HEAD, "<:raw", $headtemp) 0 0 0
164 0 { my $parser = Mail::Box::Parser::Perl->new
165 ( filename => $headtemp
166 , file => \*HEAD
167 , trusted => 1
168 );
169 0 $reply_head->read($parser);
170 0 $parser->close;
171 }
172  
173 0 ▶ $args{quote} ||= delete $args{Inline} || '>';
Condition0%0/5
$args{"quote"} ||= delete $args{"Inline"} || ">"
l!l&&r!l&&!r
000
delete $args{'Inline'} || '>'
l!l
00
MC/DC0%0/2
$args{"quote"} ||= delete $args{"Inline"} || ">"
$args{"quote"} delete $args{'Inline'}
Truth table0%0/3
A ||= B
A= $args{"quote"}B= delete $args{'Inline'}
ABresult
1X1
011
000
174 0 ▶ $args{group_reply} ||= delete $args{ReplyAll} || 0;
Condition0%0/5
$args{"group_reply"} ||= delete $args{"ReplyAll"} || 0
l!l&&r!l&&!r
000
delete $args{'ReplyAll'} || 0
l!l
00
MC/DC0%0/2
$args{"group_reply"} ||= delete $args{"ReplyAll"} || 0
$args{"group_reply"} delete $args{'ReplyAll'}
Truth table0%0/3
A ||= B
A= $args{"group_reply"}B= delete $args{'ReplyAll'}
ABresult
1X1
011
000
175 0 ▶ my $keep = delete $args{Keep} || [];
Condition0%0/2
delete $args{'Keep'} || []
l!l
00
MC/DC0%0/1
delete $args{'Keep'} || []
delete $args{'Keep'}
Truth table0%0/2
A
A= delete $args{'Keep'}
Aresult
11
00
176 0 ▶ my $exclude = delete $args{Exclude} || [];
Condition0%0/2
delete $args{'Exclude'} || []
l!l
00
MC/DC0%0/1
delete $args{'Exclude'} || []
delete $args{'Exclude'}
Truth table0%0/2
A
A= delete $args{'Exclude'}
Aresult
11
00
177  
178 0 my $reply = $self->SUPER::reply(%args);
179  
180 0 my $head = $self->head;
181  
182 $reply_head->add($_->clone)
183 0 foreach map { $head->get($_) } @$keep;
184  
185 0 $reply_head->reset($_) foreach @$exclude;
186  
187 0 ref($self)->coerce($reply);
188 }
189  
190  
191 sub add_signature(;$)
192 0 ▶{ my $self = shift;
Subroutine add_signature: not called CC=3 SCAR=24.8
Pod documented
193 my $filename = shift
194 0 ▶ || File::Spec->catfile($ENV{HOME} || File::Spec->curdir, '.signature');
Condition0%0/6
shift() || 'File::Spec'->catfile($ENV{'HOME'} || 'File::Spec'->curdir, '.signature')
l!l&&r!l&&!r
000
$ENV{'HOME'} || 'File::Spec'->curdir
l!l&&r!l&&!r
000
MC/DC0%0/2
shift() || 'File::Spec'->catfile($ENV{'HOME'} || 'File::Spec'->curdir, '.signature')
shift() 'File::Spec'->catfile($ENV{'HOME'} || 'File::Spec'->curdir, '.signature')
MC/DC0%0/2
$ENV{'HOME'} || 'File::Spec'->curdir
$ENV{'HOME'} 'File::Spec'->curdir
Truth table0%0/3
A || B
A= shift()B= 'File::Spec'->catfile($ENV{'HOME'} || 'File::Spec'->curdir, '.signature')
ABresult
1X1
011
000
Truth table0%0/3
A || B
A= $ENV{'HOME'}B= 'File::Spec'->curdir
ABresult
1X1
011
000
195 0 $self->sign(File => $filename);
196 }
197  
198  
199 sub sign(@)
200 0 ▶{ my ($self, $args) = @_;
Subroutine sign: not called CC=5 SCAR=34.0
Pod documented
201 0 my $sig;
202  
203 0 ▶ if(my $filename = delete $self->{File})
Branch: 2 branches
BranchTrueFalseTotal
if (my $filename = delete $self->{'File'}) { } 0 0 0
elsif (my $sig = delete $self->{'Signature'}) { } 0 0 0
204 0 { $sig = Mail::Message::Body->new(file => $filename);
205 }
206 elsif(my $sig = delete $self->{Signature})
207 0 { $sig = Mail::Message::Body->new(data => $sig);
208 }
209  
210 0 ▶ return unless defined $sig;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $sig 0 0 0
211
212 0 my $body = $self->decoded->stripSignature;
213 0 my $set = $body->concatenate($body, "-- \n", $sig);
214 0 ▶ $self->body($set) if defined $set;
Branch: 1 branch
BranchTrueFalseTotal
if defined $set 0 0 0
215 0 $set;
216 }
217  
218  
219 sub send($@)
220 0 ▶{ my ($self, $type, %args) = @_;
Subroutine send: not called CC=1 SCAR=6.9
Pod documented
221 0 $self->send(via => $type);
222 }
223  
224  
225 sub nntppost(@)
226 0 ▶{ my ($self, %args) = @_;
Subroutine nntppost: not called CC=3 SCAR=24.8
Pod documented
227 0 ▶ $args{port} ||= delete $args{Port};
Condition0%0/3
$args{"port"} ||= delete $args{"Port"}
l!l&&r!l&&!r
000
MC/DC0%0/2
$args{"port"} ||= delete $args{"Port"}
$args{"port"} delete $args{"Port"}
Truth table0%0/3
A ||= B
A= $args{"port"}B= delete $args{"Port"}
ABresult
1X1
011
000
228 0 ▶ $args{nntp_debug} ||= delete $args{Debug};
Condition0%0/3
$args{"nntp_debug"} ||= delete $args{"Debug"}
l!l&&r!l&&!r
000
MC/DC0%0/2
$args{"nntp_debug"} ||= delete $args{"Debug"}
$args{"nntp_debug"} delete $args{"Debug"}
Truth table0%0/3
A ||= B
A= $args{"nntp_debug"}B= delete $args{"Debug"}
ABresult
1X1
011
000
229  
230 0 $self->send(via => 'nntp', %args);
231 }
232  
233  
234  
235 sub head(;$)
236 0 ▶{ my $self = shift;
Subroutine head: not called CC=3 SCAR=24.8
Pod documented
237 0 ▶ return $self->SUPER::head(@_) if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
238 0 ▶ $self->SUPER::head || $self->{MM_head_type}->new(message => $self);
Branch: 1 branch
BranchTrueFalseTotal
$self->SUPER::head or $self->{"MM_head_type"}->new("message", $self) 0 0 0
239 }
240  
241  
242 0 ▶sub header(;$) { shift->head->header(@_) }
Subroutine header: not called CC=1 SCAR=6.9
Pod documented
243  
244  
245 0 ▶sub fold(;$) { shift->head->fold(@_) }
Subroutine fold: not called CC=1 SCAR=6.9
Pod documented
246  
247  
248 0 ▶sub fold_length(;$$) { shift->head->fold_length(@_) }
Subroutine fold_length: not called CC=1 SCAR=6.9
Pod documented
249  
250  
251 0 ▶sub combine($;$) { shift->head->combine(@_) }
Subroutine combine: not called CC=1 SCAR=6.9
Pod documented
252  
253  
254 0 ▶sub print_header(@) { shift->head->print(@_) }
Subroutine print_header: not called CC=1 SCAR=6.9
Pod documented
255  
256  
257 0 ▶sub clean_header() { shift->header }
Subroutine clean_header: not called CC=1 SCAR=6.9
Pod documented
258  
259  
260 ▶sub tidy_headers() { }
Subroutine tidy_headers: not called CC=1 SCAR=0.0
Pod documented
261  
262  
263 0 ▶sub add(@) { shift->head->add(@_) }
Subroutine add: not called CC=1 SCAR=6.9
Pod documented
264  
265  
266 0 ▶sub replace(@) { shift->head->replace(@_) }
Subroutine replace: not called CC=1 SCAR=6.9
Pod documented
267  
268  
269 0 ▶sub get(@) { shift->head->get(@_) }
Subroutine get: not called CC=1 SCAR=6.9
Pod documented
270  
271  
272 sub delete(@)
273 0 ▶{ my $self = shift;
Subroutine delete: not called CC=2 SCAR=17.9
Pod documented
274 0 ▶ @_ ? $self->head->delete(@_) : $self->SUPER::delete;
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 0 0 0
275 }
276  
277 #------------
278  
279  
280 sub body(@)
281 0 ▶{ my $self = shift;
Subroutine body: not called CC=4 SCAR=30.0
Pod documented
282  
283 0 ▶ unless(@_)
Branch: 1 branch
BranchTrueFalseTotal
unless (@_) 0 0 0
284 0 { my $body = $self->body;
285 0 ▶ return defined $body ? scalar($body->lines) : [];
Branch: 1 branch
BranchTrueFalseTotal
defined $body ? : 0 0 0
286 }
287  
288 0 ▶ my $data = ref $_[0] eq 'ARRAY' ? shift : \@_;
Branch: 1 branch
BranchTrueFalseTotal
ref $_[0] eq 'ARRAY' ? : 0 0 0
289 0 my $body = Mail::Message::Body::Lines->new(data => $data);
290 0 $self->body($body);
291  
292 0 $body;
293 }
294  
295  
296 0 ▶sub print_body(@) { shift->SUPER::body->print(@_) }
Subroutine print_body: not called CC=1 SCAR=6.9
Pod documented
297  
298  
299 0 ▶sub bodyObject(;$) { shift->SUPER::body(@_) }
Subroutine bodyObject: not called CC=1 SCAR=6.9
Pod documented
300  
301  
302 sub remove_sig(;$)
303 0 ▶{ my $self = shift;
Subroutine remove_sig: not called CC=3 SCAR=24.8
Pod documented
304 0 ▶ my $lines = shift || 10;
Condition0%0/2
shift() || 10
l!l
00
MC/DC0%0/1
shift() || 10
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
305 0 my $stripped = $self->decoded->stripSignature(max_lines => $lines);
306 0 ▶ $self->body($stripped) if defined $stripped;
Branch: 1 branch
BranchTrueFalseTotal
if defined $stripped 0 0 0
307 0 $stripped;
308 }
309  
310  
311 sub tidy_body(;$)
312 0 ▶{ my $self = shift;
Subroutine tidy_body: not called CC=7 SCAR=40.3
Pod documented
313  
314 0 ▶ my $body = $self->body or return;
Branch: 1 branch
BranchTrueFalseTotal
my $body = $self->body or return 0 0 0
315 0 my @body = $body->lines;
316  
317 0 ▶ shift @body while @body && $body[0] =~ m/^\s*$/;
Branch: 1 branch
BranchTrueFalseTotal
@body and $body[0] =~ /^\s*$/ and do { shift @body } 0 0 0
Condition0%0/3
@body and $body[0] =~ /^\s*$/
!ll&&!rl&&r
000
MC/DC0%0/2
@body and $body[0] =~ /^\s*$/
@body $body[0] =~ /^\s*$/
Truth table0%0/3
A and B
A= @bodyB= $body[0] =~ /^\s*$/
ABresult
0X0
100
111
318 0 ▶ pop @body while @body && $body[-1] =~ m/^\s*$/;
Branch: 1 branch
BranchTrueFalseTotal
@body and $body[-1] =~ /^\s*$/ and do { pop @body } 0 0 0
Condition0%0/3
@body and $body[-1] =~ /^\s*$/
!ll&&!rl&&r
000
MC/DC0%0/2
@body and $body[-1] =~ /^\s*$/
@body $body[-1] =~ /^\s*$/
Truth table0%0/3
A and B
A= @bodyB= $body[-1] =~ /^\s*$/
ABresult
0X0
100
111
319  
320 0 ▶ return $body if $body->nrLines == @body;
Branch: 1 branch
BranchTrueFalseTotal
if $body->nrLines == @body 0 0 0
321 0 my $new = Mail::Message::Body::Lines->new(based_on => $body, data=>\@body);
322 0 $self->body($new);
323 }
324  
325  
326 sub smtpsend(@)
327 0 ▶{ my ($self, %args) = @_;
Subroutine smtpsend: not called CC=9 SCAR=45.0
Pod documented
328 0 ▶ my $from = $args{MailFrom} || $ENV{MAILADDRESS} || $ENV{USER} || 'unknown';
Condition0%0/8
$args{'MailFrom'} || $ENV{'MAILADDRESS'} || $ENV{'USER'} || 'unknown'
l!l
00
$args{"MailFrom"} or $ENV{"MAILADDRESS"} or $ENV{"USER"}
l!l&&r!l&&!r
000
$args{"MailFrom"} or $ENV{"MAILADDRESS"}
l!l&&r!l&&!r
000
MC/DC0%0/3
$args{'MailFrom'} || $ENV{'MAILADDRESS'} || $ENV{'USER'} || 'unknown'
$args{"MailFrom"} $ENV{"MAILADDRESS"} $ENV{"USER"}
Truth table0%0/4
A or B or C
A= $args{"MailFrom"}B= $ENV{"MAILADDRESS"}C= $ENV{"USER"}
ABCresult
1XX1
01X1
0011
0000
329 0 ▶ $args{helo} ||= delete $args{Hello};
Condition0%0/3
$args{"helo"} ||= delete $args{"Hello"}
l!l&&r!l&&!r
000
MC/DC0%0/2
$args{"helo"} ||= delete $args{"Hello"}
$args{"helo"} delete $args{"Hello"}
Truth table0%0/3
A ||= B
A= $args{"helo"}B= delete $args{"Hello"}
ABresult
1X1
011
000
330 0 ▶ $args{port} ||= delete $args{Port};
Condition0%0/3
$args{"port"} ||= delete $args{"Port"}
l!l&&r!l&&!r
000
MC/DC0%0/2
$args{"port"} ||= delete $args{"Port"}
$args{"port"} delete $args{"Port"}
Truth table0%0/3
A ||= B
A= $args{"port"}B= delete $args{"Port"}
ABresult
1X1
011
000
331 0 ▶ $args{smtp_debug} ||= delete $args{Debug};
Condition0%0/3
$args{"smtp_debug"} ||= delete $args{"Debug"}
l!l&&r!l&&!r
000
MC/DC0%0/2
$args{"smtp_debug"} ||= delete $args{"Debug"}
$args{"smtp_debug"} delete $args{"Debug"}
Truth table0%0/3
A ||= B
A= $args{"smtp_debug"}B= delete $args{"Debug"}
ABresult
1X1
011
000
332  
333 0 my $host = $args{Host};
334 0 ▶ unless(defined $host)
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $host) 0 0 0
335 0 { my $hosts = $ENV{SMTPHOSTS};
336 0 ▶ $host = (split /\:/, $hosts)[0] if defined $hosts;
Branch: 1 branch
BranchTrueFalseTotal
if defined $hosts 0 0 0
337 }
338 0 $args{host} = $host;
339  
340 0 $self->send(via => 'smtp', %args);
341 }
342  
343 #------------
344  
345  
346 sub as_mbox_string()
347 0 ▶{ my $self = shift;
Subroutine as_mbox_string: not called CC=1 SCAR=6.9
Pod documented
348 0 my $mboxmsg = Mail::Box::Mbox->coerce($self);
349  
350 0 my $buffer = '';
351 0 my $file = Mail::Box::FastScalar->new(\$buffer);
352 0 $mboxmsg->print($file);
353 0 $buffer;
354 }
355  
356 #------------
357  
358  
359 BEGIN {
360 1 ▶ no warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
361 *Mail::Internet::new = sub (@)
362 0 ▶ { my $class = shift;
Subroutine __ANON__: not called CC=1 SCAR=6.9
363 0 Mail::Message::Replace::MailInternet->new(@_);
364 1 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
365 }
366  
367  
368 sub isa($)
369 0 ▶{ my ($thing, $class) = @_;
Subroutine isa: not called CC=2 SCAR=17.9
Pod documented
370 0 ▶ return 1 if $class eq 'Mail::Internet';
Branch: 1 branch
BranchTrueFalseTotal
if $class eq "Mail::Internet" 0 0 0
371 0 $thing->SUPER::isa($class);
372 }
373  
374 #------------
375  
376  
377 sub coerce() { confess }
378  
379  
380 1 1;
381  
« Message/Body.pm ↑ Summary Message/Body/Encode.pm »