Message/Replace/MailInternet.pm

filter: Statementstmt 20.4% 37 / 181 Branchbran 0.0% 0 / 64 Conditioncond 0.0% 0 / 70 MC/DCmcdc 0.0% 0 / 39 Subroutinesub 25.0% 12 / 48 Podpod 94.2% 33 / 35 totaltotal 18.7% 82 / 437 CC 61 SCAR 39.1
CC
61
Cov
12%
processRawData
156.0
reply
132.0
smtpsend
90.0
CRAP 49.9
« Message/Body.pm ↑ Summary Message/Body/Encode.pm »
1 # This code is part of Perl distribution Mail-Message version 4.05.
2 # The POD got stripped from this file by OODoc version 3.06.
3 # For contributors see file ChangeLog.
4  
5 # This software is copyright (c) 2001-2026 by Mark Overmeer.
6  
7 # This is free software; you can redistribute it and/or modify it under
8 # the same terms as the Perl 5 programming language system itself.
9 # SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later
10  
11  
12 package Mail::Message::Replace::MailInternet;{
13 1 our $VERSION = '4.05';
14 }
15  
16 1 ▶use parent 'Mail::Message';
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 1 ▶use Log::Report 'mail-message', import => [ qw/__x error/ ];
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 1 ▶use Mail::Box::FastScalar ();
Subroutine BEGIN: called CC=1 SCAR=0.0
24 1 ▶use Mail::Box::Parser::Perl ();
Subroutine BEGIN: called CC=1 SCAR=0.0
25 1 ▶use Mail::Message::Body::Lines ();
Subroutine BEGIN: called CC=1 SCAR=0.0
26  
27 1 ▶use IO::Handle ();
Subroutine BEGIN: called CC=1 SCAR=0.0
28 1 ▶use File::Spec ();
Subroutine BEGIN: called CC=1 SCAR=0.0
29  
30 1 ▶use Scalar::Util qw/blessed/;
Subroutine BEGIN: called CC=1 SCAR=0.0
31  
32 #--------------------
33  
34 sub new(@)
35 0 ▶{ my $class = shift;
Subroutine new: not called CC=3 SCAR=24.8
Pod documented
36 0 ▶ my $data = @_ % 2 ? shift : undef;
Branch: 1 branch
BranchTrueFalseTotal
@_ % 2 ? : 0 0 0
37 0 ▶ $class = __PACKAGE__ if $class eq 'Mail::Internet';
Branch: 1 branch
BranchTrueFalseTotal
if $class eq "Mail::Internet" 0 0 0
38 0 $class->SUPER::new(@_, raw_data => $data);
39 }
40  
41 sub init($)
42 0 ▶{ my ($self, $args) = @_;
Subroutine init: not called CC=7 SCAR=40.3
Pod undocumented
43 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
44 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
45 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
46 0 $self->SUPER::init($args);
47  
48 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
49 0 $self->{MI_mail_from} = $args->{MailFrom};
50 0 ▶ $self->{MI_modify} = exists $args->{Modify} ? $args->{Modify} : 1;
Branch: 1 branch
BranchTrueFalseTotal
exists $args->{'Modify'} ? : 0 0 0
51  
52 $self->processRawData($self->{raw_data}, !defined $args->{Header},
53 0 ▶ !defined $args->{Body}) if defined $self->{raw_data};
Branch: 1 branch
BranchTrueFalseTotal
if defined $self->{"raw_data"} 0 0 0
54  
55 0 $self;
56 }
57  
58 sub processRawData($$$)
59 0 ▶{ my ($self, $data, $get_head, $get_body) = @_;
Subroutine processRawData: not called CC=12 SCAR=50.5
Pod undocumented
60 0 ▶ $get_head || $get_body or return $self;
Branch: 1 branch
BranchTrueFalseTotal
$get_head or $get_body or return $self 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
61  
62 0 my ($filename, $lines);
63 0 ▶ if(ref $data eq 'ARRAY')
Branch: 2 branches
BranchTrueFalseTotal
if (ref $data eq 'ARRAY') { } 0 0 0
elsif (ref $data eq 'GLOB' or builtin::blessed($data) and $data->isa('IO::Handle')) { } 0 0 0
64 0 { $filename = 'array of lines';
65 0 $lines = $data;
66 }
67 ▶ elsif(ref $data eq 'GLOB' || (blessed $data && $data->isa('IO::Handle')))
Condition0%0/6
ref $data eq "GLOB" or builtin::blessed($data) and $data->isa("IO::Handle")
l!l&&r!l&&!r
000
builtin::blessed($data) and $data->isa("IO::Handle")
!ll&&!rl&&r
000
MC/DC0%0/3
ref $data eq "GLOB" or builtin::blessed($data) and $data->isa("IO::Handle")
ref $data eq "GLOB" builtin::blessed($data) $data->isa("IO::Handle")
Truth table0%0/4
A or B and C
A= ref $data eq "GLOB"B= builtin::blessed($data)C= $data->isa("IO::Handle")
ABCresult
1XX1
0111
00X0
0100
68 0 { $filename = 'file (' . (ref $data) . ')';
69 0 $lines = [ $data->getlines ];
70 }
71 else
72 0 { error __x"Mail::Internet does not support {what UNKNOWN} data.", what => $data;
73 }
74  
75 0 ▶ @$lines or return;
Branch: 1 branch
BranchTrueFalseTotal
@$lines or return 0 0 0
76  
77 0 my $buffer = join '', @$lines;
78 0 my $file = Mail::Box::FastScalar->new(\$buffer);
79 0 my $parser = Mail::Box::Parser::Perl->new(filename => $filename, file => $file, trusted => 1);
80  
81 0 my $head;
82 0 ▶ if($get_head)
Branch: 1 branch
BranchTrueFalseTotal
if ($get_head) { } 0 0 0
83 0 ▶ { my $from = $lines->[0] =~ m/^From / ? shift @$lines : undef;
Branch: 1 branch
BranchTrueFalseTotal
$lines->[0] =~ /^From / ? : 0 0 0
84  
85 my $head = $self->{MM_head_type}->new(
86 MailFrom => $self->{MI_mail_from},
87 Modify => $self->{MI_modify},
88 FoldLength => $self->{MI_wrap}
89 0 );
90 0 $head->read($parser);
91 0 ▶ $head->mail_from($from) if defined $from;
Branch: 1 branch
BranchTrueFalseTotal
if defined $from 0 0 0
92 0 $self->head($head);
93 }
94 else
95 0 { $head = $self->head;
96 }
97  
98 0 ▶ $self->storeBody($self->readBody($parser, $head)) if $get_body;
Branch: 1 branch
BranchTrueFalseTotal
if $get_body 0 0 0
99 0 $self->addReport($parser);
100 0 $parser->stop;
101 0 $self;
102 }
103  
104  
105 sub dup()
106 0 ▶{ my $self = shift;
Subroutine dup: not called CC=1 SCAR=6.9
Pod documented
107 0 (ref $self)->coerce($self->clone);
108 }
109  
110  
111 0 ▶sub empty() { $_[0]->DESTROY }
Subroutine empty: not called CC=1 SCAR=6.9
Pod documented
112  
113 #--------------------
114  
115 sub MailFrom(;$)
116 0 ▶{ my $self = shift;
Subroutine MailFrom: not called CC=2 SCAR=17.9
Pod documented
117 0 ▶ @_ ? ($self->{MI_mail_from} = shift) : $self->{MU_mail_from};
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 0 0 0
118 }
119  
120 #--------------------
121  
122 sub read($@)
123 0 ▶{ my $thing = shift;
Subroutine read: not called CC=2 SCAR=17.9
Pod documented
124  
125 0 ▶ blessed $thing
Branch: 1 branch
BranchTrueFalseTotal
builtin::blessed($thing) or return $thing->SUPER::read(@_) 0 0 0
126 or return $thing->SUPER::read(@_); # Mail::Message behavior
127  
128 # Mail::Header emulation
129 0 my $data = shift;
130 0 $thing->processRawData($data, 1, 1);
131 }
132  
133  
134 sub read_body($)
135 0 ▶{ my ($self, $data) = @_;
Subroutine read_body: not called CC=1 SCAR=6.9
Pod documented
136 0 $self->processRawData($data, 0, 1);
137 }
138  
139  
140 sub read_header($)
141 0 ▶{ my ($self, $data) = @_;
Subroutine read_header: not called CC=1 SCAR=6.9
Pod documented
142 0 $self->processRawData($data, 1, 0);
143 }
144  
145  
146 sub extract($)
147 0 ▶{ my ($self, $data) = @_;
Subroutine extract: not called CC=1 SCAR=6.9
Pod documented
148 0 $self->processRawData($data, 1, 1);
149 }
150  
151  
152 sub reply(@)
153 0 ▶{ my ($self, %args) = @_;
Subroutine reply: not called CC=11 SCAR=48.8
Pod documented
154  
155 0 my $reply_head = $self->{MM_head_type}->new;
156 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
157 0 my $headtemp = File::Spec->catfile($home, '.mailhdr');
158  
159 0 ▶ if(open my $head, '<:raw', $headtemp)
Branch: 1 branch
BranchTrueFalseTotal
if (open my $head, "<:raw", $headtemp) 0 0 0
160 0 { my $parser = Mail::Box::Parser::Perl->new(filename => $headtemp, file => $head, trusted => 1);
161 0 $reply_head->read($parser);
162 0 $parser->close;
163 }
164  
165 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
166 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
167 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
168 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
169  
170 0 my $reply = $self->SUPER::reply(%args);
171 0 my $head = $self->head;
172  
173 0 $reply_head->add($_->clone) for map $head->get($_), @$keep;
174 0 $reply_head->reset($_) for @$exclude;
175  
176 0 (ref $self)->coerce($reply);
177 }
178  
179  
180 sub add_signature(;$)
181 0 ▶{ my $self = shift;
Subroutine add_signature: not called CC=3 SCAR=24.8
Pod documented
182 0 ▶ my $fn = shift // 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
183 0 $self->sign(File => $fn);
184 }
185  
186  
187 sub sign(@)
188 0 ▶{ my ($self, $args) = @_;
Subroutine sign: not called CC=5 SCAR=34.0
Pod documented
189 0 my $sig;
190  
191 0 ▶ if(my $filename = delete $self->{File})
Branch: 2 branches
BranchTrueFalseTotal
if (my $filename = delete $self->{'File'}) { } 0 0 0
elsif (my $sign = delete $self->{'Signature'}) { } 0 0 0
192 0 { $sig = Mail::Message::Body->new(file => $filename);
193 }
194 elsif(my $sign = delete $self->{Signature})
195 0 { $sig = Mail::Message::Body->new(data => $sign);
196 }
197  
198 0 ▶ defined $sig or return;
Branch: 1 branch
BranchTrueFalseTotal
defined $sig or return 0 0 0
199  
200 0 my $body = $self->decoded->stripSignature;
201 0 my $set = $body->concatenate($body, "-- \n", $sig);
202 0 ▶ $self->body($set) if defined $set;
Branch: 1 branch
BranchTrueFalseTotal
if defined $set 0 0 0
203 0 $set;
204 }
205  
206 #--------------------
207  
208 sub send($@)
209 0 ▶{ my ($self, $type, %args) = @_;
Subroutine send: not called CC=1 SCAR=6.9
Pod documented
210 0 $self->send(via => $type);
211 }
212  
213  
214 #--------------------
215  
216 sub head(;$)
217 0 ▶{ my $self = shift;
Subroutine head: not called CC=3 SCAR=24.8
Pod documented
218 0 ▶ return $self->SUPER::head(@_) if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
219 0 ▶ $self->SUPER::head // $self->{MM_head_type}->new(message => $self);
Condition0%0/3
$self->SUPER::head // $self->{"MM_head_type"}->new("message", $self)
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->SUPER::head // $self->{"MM_head_type"}->new("message", $self)
$self->SUPER::head $self->{"MM_head_type"}->new("message", $self)
Truth table0%0/3
A // B
A= $self->SUPER::headB= $self->{"MM_head_type"}->new("message", $self)
ABresult
1X1
011
000
220 }
221  
222  
223 0 ▶sub header(;$) { shift->head->header(@_) }
Subroutine header: not called CC=1 SCAR=6.9
Pod documented
224  
225  
226 0 ▶sub fold(;$) { shift->head->fold(@_) }
Subroutine fold: not called CC=1 SCAR=6.9
Pod documented
227  
228  
229 0 ▶sub fold_length(;$$) { shift->head->fold_length(@_) }
Subroutine fold_length: not called CC=1 SCAR=6.9
Pod documented
230  
231  
232 0 ▶sub combine($;$) { shift->head->combine(@_) }
Subroutine combine: not called CC=1 SCAR=6.9
Pod documented
233  
234  
235 0 ▶sub print_header(@) { shift->head->print(@_) }
Subroutine print_header: not called CC=1 SCAR=6.9
Pod documented
236  
237  
238 0 ▶sub clean_header() { $_[0]->header }
Subroutine clean_header: not called CC=1 SCAR=6.9
Pod documented
239  
240  
241 0 ▶sub tidy_headers() { }
Subroutine tidy_headers: not called CC=1 SCAR=0.0
Pod documented
242  
243  
244 0 ▶sub add(@) { shift->head->add(@_) }
Subroutine add: not called CC=1 SCAR=6.9
Pod documented
245  
246  
247 0 ▶sub replace(@) { shift->head->replace(@_) }
Subroutine replace: not called CC=1 SCAR=6.9
Pod documented
248  
249  
250 0 ▶sub get(@) { shift->head->get(@_) }
Subroutine get: not called CC=1 SCAR=6.9
Pod documented
251  
252  
253 sub delete(@)
254 0 ▶{ my $self = shift;
Subroutine delete: not called CC=2 SCAR=17.9
Pod documented
255 0 ▶ @_ ? $self->head->delete(@_) : $self->SUPER::delete;
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 0 0 0
256 }
257  
258 #--------------------
259  
260 sub body(@)
261 0 ▶{ my $self = shift;
Subroutine body: not called CC=4 SCAR=30.0
Pod documented
262  
263 0 ▶ unless(@_)
Branch: 1 branch
BranchTrueFalseTotal
unless (@_) 0 0 0
264 0 { my $body = $self->body;
265 0 ▶ return defined $body ? (scalar $body->lines) : [];
Branch: 1 branch
BranchTrueFalseTotal
defined $body ? : 0 0 0
266 }
267  
268 0 ▶ my $data = ref $_[0] eq 'ARRAY' ? shift : \@_;
Branch: 1 branch
BranchTrueFalseTotal
ref $_[0] eq 'ARRAY' ? : 0 0 0
269 0 my $body = Mail::Message::Body::Lines->new(data => $data);
270 0 $self->body($body);
271  
272 0 $body;
273 }
274  
275  
276 0 ▶sub print_body(@) { shift->SUPER::body->print(@_) }
Subroutine print_body: not called CC=1 SCAR=6.9
Pod documented
277  
278  
279 0 ▶sub bodyObject(;$) { shift->SUPER::body(@_) }
Subroutine bodyObject: not called CC=1 SCAR=6.9
Pod documented
280  
281  
282 sub remove_sig(;$)
283 0 ▶{ my ($self, $lines) = @_;
Subroutine remove_sig: not called CC=3 SCAR=24.8
Pod documented
284 0 ▶ my $stripped = $self->decoded->stripSignature(max_lines => $lines // 10);
Condition0%0/2
$lines // 10
l!l
00
MC/DC0%0/1
$lines // 10
$lines
Truth table0%0/2
A
A= $lines
Aresult
11
00
285 0 ▶ $self->body($stripped) if defined $stripped;
Branch: 1 branch
BranchTrueFalseTotal
if defined $stripped 0 0 0
286 0 $stripped;
287 }
288  
289  
290 sub tidy_body(;$)
291 0 ▶{ my $self = shift;
Subroutine tidy_body: not called CC=7 SCAR=40.3
Pod documented
292  
293 0 ▶ my $body = $self->body or return;
Branch: 1 branch
BranchTrueFalseTotal
my $body = $self->body or return 0 0 0
294 0 my @body = $body->lines;
295  
296 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
297 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
298  
299 0 ▶ return $body if $body->nrLines == @body;
Branch: 1 branch
BranchTrueFalseTotal
if $body->nrLines == @body 0 0 0
300 0 my $new = Mail::Message::Body::Lines->new(based_on => $body, data=>\@body);
301 0 $self->body($new);
302 }
303  
304  
305 sub smtpsend(@)
306 0 ▶{ my ($self, %args) = @_;
Subroutine smtpsend: not called CC=9 SCAR=45.0
Pod documented
307 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
308 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
309 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
310 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
311  
312 0 my $host = $args{Host};
313 0 ▶ unless(defined $host)
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $host) 0 0 0
314 0 { my $hosts = $ENV{SMTPHOSTS};
315 0 ▶ $host = (split /\:/, $hosts)[0] if defined $hosts;
Branch: 1 branch
BranchTrueFalseTotal
if defined $hosts 0 0 0
316 }
317 0 $args{host} = $host;
318  
319 0 $self->send(via => 'smtp', %args);
320 }
321  
322 #--------------------
323  
324 sub as_mbox_string()
325 0 ▶{ my $self = shift;
Subroutine as_mbox_string: not called CC=1 SCAR=6.9
Pod documented
326 0 my $mboxmsg = Mail::Box::Mbox->coerce($self);
327  
328 0 my $buffer = '';
329 0 my $file = Mail::Box::FastScalar->new(\$buffer);
330 0 $mboxmsg->print($file);
331 0 $buffer;
332 }
333  
334 #--------------------
335  
336 1 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.4
337 1 ▶ no warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
338 0 ▶ *Mail::Internet::new = sub (@) {
Subroutine __ANON__: not called CC=1 SCAR=6.9
339 0 my $class = shift;
340 0 Mail::Message::Replace::MailInternet->new(@_);
341 1 };
342 }
343  
344  
345 sub isa($)
346 0 ▶{ my ($thing, $class) = @_;
Subroutine isa: not called CC=2 SCAR=17.9
Pod documented
347 0 ▶ $class eq 'Mail::Internet' ? 1 : $thing->SUPER::isa($class);
Branch: 1 branch
BranchTrueFalseTotal
$class eq 'Mail::Internet' ? : 0 0 0
348 }
349  
350 #--------------------
351  
352 0 ▶sub coerce() { $_[0]->notImplemented }
Subroutine coerce: not called CC=1 SCAR=6.9
Pod documented
353  
354 1 1;
« Message/Body.pm ↑ Summary Message/Body/Encode.pm »