| 1 | # Copyrights 2001-2020 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.02. | ||||||||||||||||||||||||
| 5 | # This code is part of distribution Mail-Box. 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::Box::Net; | ||||||||||||||||||||||||
| 10 | 1 | ▶ | use vars '$VERSION'; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 11 | 1 | $VERSION = '3.009'; | |||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||
| 14 | 1 | ▶ | use strict; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 15 | 1 | ▶ | use warnings; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||
| 17 | 1 | ▶ | use base 'Mail::Box'; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||
| 19 | 1 | ▶ | use Mail::Box::Net::Message; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||
| 21 | 1 | ▶ | use Mail::Message::Body::Lines; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 22 | 1 | ▶ | use Mail::Message::Body::File; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 23 | 1 | ▶ | use Mail::Message::Body::Delayed; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 24 | 1 | ▶ | use Mail::Message::Body::Multipart; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||
| 26 | 1 | ▶ | use Mail::Message::Head; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 27 | 1 | ▶ | use Mail::Message::Head::Delayed; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||
| 29 | 1 | ▶ | use Carp; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 30 | 1 | ▶ | use File::Copy; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 31 | 1 | ▶ | use File::Spec; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 32 | 1 | ▶ | use File::Basename; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||
| 35 | sub init($) | ||||||||||||||||||||||||
| 36 | 0 | ▶ | { my ($self, $args) = @_; | ||||||||||||||||||||||
|
Subroutine
init: not called CC=12 SCAR=50.5
Pod
undocumented
| |||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||
| 38 | 0 | ▶ | $args->{lock_type} ||= 'NONE'; | ||||||||||||||||||||||
|
Condition0%0/2
$args->{"lock_type"} ||= "NONE"
MC/DC0%0/1
$args->{"lock_type"} ||= "NONE"
$args->{"lock_type"}
Truth table0%0/2
A
A= $args->{"lock_type"}
| |||||||||||||||||||||||||
| 39 | 0 | ▶ | $args->{body_type} ||= 'Mail::Message::Body::Lines'; | ||||||||||||||||||||||
|
Condition0%0/2
$args->{"body_type"} ||= "Mail::Message::Body::Lines"
MC/DC0%0/1
$args->{"body_type"} ||= "Mail::Message::Body::Lines"
$args->{"body_type"}
Truth table0%0/2
A
A= $args->{"body_type"}
| |||||||||||||||||||||||||
| 40 | 0 | ▶ | $args->{trusted} ||= 0; | ||||||||||||||||||||||
|
Condition0%0/2
$args->{"trusted"} ||= 0
MC/DC0%0/1
$args->{"trusted"} ||= 0
$args->{"trusted"}
Truth table0%0/2
A
A= $args->{"trusted"}
| |||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||
| 42 | 0 | my ($scheme, $s, $port, $u, $pwd, $f); | |||||||||||||||||||||||
| 43 | 0 | ▶ | if(my $d = $args->{folderdir}) | ||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||
| 44 | { # cannot use URI, because some scheme's are fake | ||||||||||||||||||||||||
| 45 | 0 | ($scheme, $u, $pwd, $s, $port, $f) = $d =~ | |||||||||||||||||||||||
| 46 | m! ^ (\w+) \:// # scheme | ||||||||||||||||||||||||
| 47 | (?: ( [^:\@/]+ ) # username | ||||||||||||||||||||||||
| 48 | (?: \: ( [^\@/]+ ))? # password | ||||||||||||||||||||||||
| 49 | \@ )? | ||||||||||||||||||||||||
| 50 | ( [a-zA-Z0-9.-]+ )? # hostname | ||||||||||||||||||||||||
| 51 | (?: \: ([0-9]+) )? # port | ||||||||||||||||||||||||
| 52 | ( / .* )? # path | ||||||||||||||||||||||||
| 53 | !x; | ||||||||||||||||||||||||
| 54 | 0 | $args->{folderdir} =~ s!/$!!; | |||||||||||||||||||||||
| 55 | } | ||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||
| 57 | 0 | ▶ | $args->{folder} ||= $f || '/'; | ||||||||||||||||||||||
|
Condition0%0/5
$args->{"folder"} ||= $f || "/"
$f || '/'
MC/DC0%0/2
$args->{"folder"} ||= $f || "/"
$args->{"folder"}
$f
Truth table0%0/3
A ||= B
A= $args->{"folder"}B= $f
| |||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||
| 59 | 0 | $self->SUPER::init($args); | |||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||
| 61 | 0 | ▶ | $self->{MBN_hostname} = $args->{server_name} || $s; | ||||||||||||||||||||||
|
Condition0%0/3
$args->{'server_name'} || $s
MC/DC0%0/2
$args->{'server_name'} || $s
$args->{'server_name'}
$s
Truth table0%0/3
A || B
A= $args->{'server_name'}B= $s
| |||||||||||||||||||||||||
| 62 | 0 | ▶ | $self->{MBN_port} = $args->{server_port} || $port; | ||||||||||||||||||||||
|
Condition0%0/3
$args->{'server_port'} || $port
MC/DC0%0/2
$args->{'server_port'} || $port
$args->{'server_port'}
$port
Truth table0%0/3
A || B
A= $args->{'server_port'}B= $port
| |||||||||||||||||||||||||
| 63 | 0 | ▶ | $self->{MBN_username} = $args->{username} || $u; | ||||||||||||||||||||||
|
Condition0%0/3
$args->{'username'} || $u
MC/DC0%0/2
$args->{'username'} || $u
$args->{'username'}
$u
Truth table0%0/3
A || B
A= $args->{'username'}B= $u
| |||||||||||||||||||||||||
| 64 | 0 | ▶ | $self->{MBN_password} = $args->{password} || $pwd; | ||||||||||||||||||||||
|
Condition0%0/3
$args->{'password'} || $pwd
MC/DC0%0/2
$args->{'password'} || $pwd
$args->{'password'}
$pwd
Truth table0%0/3
A || B
A= $args->{'password'}B= $pwd
| |||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||
| 66 | $self->log(WARNING => "The term 'hostname' is confusing wrt folder. You probably need 'server_name'") | ||||||||||||||||||||||||
| 67 | 0 | ▶ | if exists $args->{hostname}; | ||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||
| 69 | 0 | $self; | |||||||||||||||||||||||
| 70 | } | ||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||
| 73 | 0 | ▶ | sub create(@) {shift->notImplemented} | ||||||||||||||||||||||
|
Subroutine
create: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||
| 74 | sub organization() { 'REMOTE' } | ||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||
| 76 | sub url() | ||||||||||||||||||||||||
| 77 | 0 | ▶ | { my $self = shift; | ||||||||||||||||||||||
|
Subroutine
url: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||
| 79 | my ($user, $pass, $host, $port) | ||||||||||||||||||||||||
| 80 | 0 | = @$self{ qw/MBN_username MBN_password MBN_hostname MBN_port/ }; | |||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||
| 82 | 0 | my $perm = ''; | |||||||||||||||||||||||
| 83 | 0 | ▶ | $perm = $user if defined $user; | ||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||
| 84 | 0 | ▶ | if(defined $pass) | ||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||
| 85 | 0 | { $pass =~ s/(\W)/sprintf "%%%02X", ord $1/ge; | |||||||||||||||||||||||
| 86 | 0 | $perm .= ':'.$pass; | |||||||||||||||||||||||
| 87 | } | ||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||
| 89 | 0 | ▶ | $perm .= '@' if length $perm; | ||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||
| 91 | 0 | my $loc = $host; | |||||||||||||||||||||||
| 92 | 0 | ▶ | $loc .= ':'.$port if length $port; | ||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||
| 94 | 0 | my $name = $self->name; | |||||||||||||||||||||||
| 95 | 0 | ▶ | $loc .= '/'.$name if $name ne '/'; | ||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||
| 97 | 0 | $self->type . '://' . $perm . $loc; | |||||||||||||||||||||||
| 98 | } | ||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||
| 100 | 1 | 1; | |||||||||||||||||||||||