| 1 | # This code is part of Perl distribution Mail-Box version 4.02. | ||||||||||||||||||||||||||||||||||||||||||
| 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::Box::Maildir;{ | ||||||||||||||||||||||||||||||||||||||||||
| 13 | 6 | our $VERSION = '4.02'; | |||||||||||||||||||||||||||||||||||||||||
| 14 | } | ||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||
| 16 | 6 | ▶ | use parent 'Mail::Box::Dir'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||
| 18 | 6 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 19 | 6 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||
| 21 | 6 | ▶ | use Log::Report 'mail-box', import => [ qw/__x error fault info trace/ ]; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||
| 23 | 6 | ▶ | use Mail::Box::Maildir::Message; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||
| 25 | 6 | ▶ | use File::Copy qw/move/; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 26 | 6 | ▶ | use File::Basename qw/basename/; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 27 | 6 | ▶ | use Sys::Hostname qw/hostname/; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 28 | 6 | ▶ | use File::Remove qw/remove/; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||||
| 30 | # Maildir is only supported on UNIX, because the filenames probably | ||||||||||||||||||||||||||||||||||||||||||
| 31 | # do not work on other platforms. Since MailBox 2.052, the use of | ||||||||||||||||||||||||||||||||||||||||||
| 32 | # File::Spec to create filenames has been removed: benchmarks showed | ||||||||||||||||||||||||||||||||||||||||||
| 33 | # that catfile() consumed 20% of the time of a folder open(). And | ||||||||||||||||||||||||||||||||||||||||||
| 34 | # '/' file separators work on Windows too! | ||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||
| 36 | #-------------------- | ||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||
| 38 | 6 | ▶ | my $default_folder_dir = exists $ENV{HOME} ? "$ENV{HOME}/.maildir" : '.'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||
| 40 | sub init($) | ||||||||||||||||||||||||||||||||||||||||||
| 41 | 7 | ▶ | { my ($self, $args) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
init: called CC=6 SCAR=19.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||||||||||
| 43 | 7 | ▶ | ! exists $args->{locker} && (! defined $args->{lock_type} || $args->{lock_type} eq 'NONE') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%3/6
not exists $args->{"locker"} and !defined($args->{"lock_type"}) || $args->{"lock_type"} eq "NONE"
not defined $args->{"lock_type"} or $args->{"lock_type"} eq "NONE"
MC/DC0%0/3
not exists $args->{"locker"} and !defined($args->{"lock_type"}) || $args->{"lock_type"} eq "NONE"
not exists $args->{"locker"}
not defined $args->{"lock_type"}
$args->{"lock_type"} eq "NONE"
Truth table50%2/4
not(A) and not(B) or C
A= not exists $args->{"locker"}B= not defined $args->{"lock_type"}C= $args->{"lock_type"} eq "NONE"
| |||||||||||||||||||||||||||||||||||||||||||
| 44 | or error __x"no locking possible for maildir folders."; | ||||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||
| 46 | 7 | $args->{lock_type} = 'NONE'; | |||||||||||||||||||||||||||||||||||||||||
| 47 | 7 | ▶ | $args->{folderdir} ||= $default_folder_dir; | ||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$args->{"folderdir"} ||= $default_folder_dir
MC/DC0%0/2
$args->{"folderdir"} ||= $default_folder_dir
$args->{"folderdir"}
$default_folder_dir
Truth table66%2/3
A ||= B
A= $args->{"folderdir"}B= $default_folder_dir
| |||||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||
| 49 | 7 | $self->SUPER::init($args); | |||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||
| 51 | 7 | ▶ | $self->acceptMessages if $args->{accept_new}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 52 | 7 | $self; | |||||||||||||||||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||||||||||||||
| 56 | sub create($@) | ||||||||||||||||||||||||||||||||||||||||||
| 57 | 0 | ▶ | { my ($thingy, $name, %args) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 58 | 0 | ▶ | my $class = ref $thingy || $thingy; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
ref $thingy || $thingy
MC/DC0%0/2
ref $thingy || $thingy
ref $thingy
$thingy
Truth table0%0/3
A || B
A= ref $thingyB= $thingy
| |||||||||||||||||||||||||||||||||||||||||||
| 59 | 0 | ▶ | my $folderdir = $args{folderdir} || $default_folder_dir; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$args{'folderdir'} || $default_folder_dir
MC/DC0%0/2
$args{'folderdir'} || $default_folder_dir
$args{'folderdir'}
$default_folder_dir
Truth table0%0/3
A || B
A= $args{'folderdir'}B= $default_folder_dir
| |||||||||||||||||||||||||||||||||||||||||||
| 60 | 0 | my $directory = $class->folderToDirectory($name, $folderdir); | |||||||||||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||||||||||||
| 62 | 0 | $class->createDirs($directory); | |||||||||||||||||||||||||||||||||||||||||
| 63 | 0 | trace "created folder Maildir $name."; | |||||||||||||||||||||||||||||||||||||||||
| 64 | 0 | $directory; | |||||||||||||||||||||||||||||||||||||||||
| 65 | } | ||||||||||||||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||||||||||||||
| 67 | sub foundIn($@) | ||||||||||||||||||||||||||||||||||||||||||
| 68 | 5 | ▶ | { my $class = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
foundIn: called CC=3 SCAR=11.2
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 69 | 5 | ▶ | my $name = @_ % 2 ? shift : undef; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 70 | 5 | my %args = @_; | |||||||||||||||||||||||||||||||||||||||||
| 71 | 5 | ▶ | my $folderdir = $args{folderdir} || $default_folder_dir; | ||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$args{'folderdir'} || $default_folder_dir
MC/DC0%0/2
$args{'folderdir'} || $default_folder_dir
$args{'folderdir'}
$default_folder_dir
Truth table66%2/3
A || B
A= $args{'folderdir'}B= $default_folder_dir
| |||||||||||||||||||||||||||||||||||||||||||
| 72 | 5 | my $directory = $class->folderToDirectory($name, $folderdir); | |||||||||||||||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||||||||||||||||
| 74 | 5 | -d "$directory/cur"; | |||||||||||||||||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||||||||||||||
| 77 | sub type() { 'maildir' } | ||||||||||||||||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||||||||||||||
| 79 | sub listSubFolders(@) | ||||||||||||||||||||||||||||||||||||||||||
| 80 | 0 | ▶ | { my ($class, %args) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
listSubFolders: not called CC=14 SCAR=53.5
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 81 | 0 | my $dir; | |||||||||||||||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||||||||||||||||
| 83 | 0 | ▶ | if(ref $class) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 84 | 0 | { $dir = $class->directory; | |||||||||||||||||||||||||||||||||||||||||
| 85 | 0 | $class = ref $class; | |||||||||||||||||||||||||||||||||||||||||
| 86 | } | ||||||||||||||||||||||||||||||||||||||||||
| 87 | else | ||||||||||||||||||||||||||||||||||||||||||
| 88 | 0 | ▶ | { my $folder = $args{folder} || '='; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$args{'folder'} || '='
MC/DC0%0/1
$args{'folder'} || '='
$args{'folder'}
Truth table0%0/2
A
A= $args{'folder'}
| |||||||||||||||||||||||||||||||||||||||||||
| 89 | 0 | ▶ | my $folderdir = $args{folderdir} || $default_folder_dir; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$args{'folderdir'} || $default_folder_dir
MC/DC0%0/2
$args{'folderdir'} || $default_folder_dir
$args{'folderdir'}
$default_folder_dir
Truth table0%0/3
A || B
A= $args{'folderdir'}B= $default_folder_dir
| |||||||||||||||||||||||||||||||||||||||||||
| 90 | 0 | $dir = $class->folderToDirectory($folder, $folderdir); | |||||||||||||||||||||||||||||||||||||||||
| 91 | } | ||||||||||||||||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||||||||||||||
| 93 | 0 | ▶ | $args{skip_empty} ||= 0; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$args{"skip_empty"} ||= 0
MC/DC0%0/1
$args{"skip_empty"} ||= 0
$args{"skip_empty"}
Truth table0%0/2
A
A= $args{"skip_empty"}
| |||||||||||||||||||||||||||||||||||||||||||
| 94 | 0 | ▶ | $args{check} ||= 0; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$args{"check"} ||= 0
MC/DC0%0/1
$args{"check"} ||= 0
$args{"check"}
Truth table0%0/2
A
A= $args{"check"}
| |||||||||||||||||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||||||||||||||||
| 96 | # Read the directories from the directory, to find all folders | ||||||||||||||||||||||||||||||||||||||||||
| 97 | # stored here. Some directories have to be removed because they | ||||||||||||||||||||||||||||||||||||||||||
| 98 | # are created by all kinds of programs, but are no folders. | ||||||||||||||||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||||||||||||||||
| 100 | 0 | ▶ | -d $dir && opendir my $dh, $dir | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
-d $dir and opendir my $dh, $dir
MC/DC0%0/2
-d $dir and opendir my $dh, $dir
-d $dir
opendir my $dh, $dir
Truth table0%0/3
A and B
A= -d $dirB= opendir my $dh, $dir
| |||||||||||||||||||||||||||||||||||||||||||
| 101 | or return (); | ||||||||||||||||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||||||||||||||||
| 103 | 0 | my @dirs; | |||||||||||||||||||||||||||||||||||||||||
| 104 | 0 | ▶ | while(my $d = readdir $dh) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 105 | 0 | ▶ | { next if $d =~ m/^(new|tmp|cur|\.\.?)$/; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||||||||||||||||
| 107 | 0 | my $dir = "$dir/$d"; | |||||||||||||||||||||||||||||||||||||||||
| 108 | 0 | ▶ | push @dirs, $d if -d $dir; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 109 | } | ||||||||||||||||||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||||||||||||||||
| 111 | 0 | closedir $dh; | |||||||||||||||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||||||||||||||||
| 113 | # Skip empty folders. | ||||||||||||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||||||||||||
| 115 | @dirs = grep !$class->folderIsEmpty("$dir/$_"), @dirs | ||||||||||||||||||||||||||||||||||||||||||
| 116 | 0 | ▶ | if $args{skip_empty}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||||||||||||||||
| 118 | # Check if the files we want to return are really folders. | ||||||||||||||||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||||||||||||||||
| 120 | 0 | ▶ | @dirs = map { m/(.*)/ && $1 } @dirs; # untaint | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
/(.*)/ && $1
MC/DC0%0/2
/(.*)/ && $1
/(.*)/
$1
Truth table0%0/3
A && B
A= /(.*)/B= $1
| |||||||||||||||||||||||||||||||||||||||||||
| 121 | 0 | ▶ | $args{check} or return @dirs; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||||||||||||||||
| 123 | 0 | grep $class->foundIn("$dir/$_"), @dirs; | |||||||||||||||||||||||||||||||||||||||||
| 124 | } | ||||||||||||||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||||||||||||||
| 126 | sub openSubFolder($@) | ||||||||||||||||||||||||||||||||||||||||||
| 127 | 0 | ▶ | { my ($self, $name) = (shift, shift); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
openSubFolder: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 128 | 0 | $self->createDirs($self->nameOfSubFolder($name)); | |||||||||||||||||||||||||||||||||||||||||
| 129 | 0 | $self->SUPER::openSubFolder($name, @_); | |||||||||||||||||||||||||||||||||||||||||
| 130 | } | ||||||||||||||||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||||||||||||||||
| 132 | sub topFolderWithMessages() { 1 } | ||||||||||||||||||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||||||||||||||||
| 134 | 6 | my $uniq = rand 1000; | |||||||||||||||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||||||||||||||||||
| 137 | sub coerce($) | ||||||||||||||||||||||||||||||||||||||||||
| 138 | 2 | ▶ | { my ($self, $message) = (shift, shift); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
coerce: called CC=4 SCAR=14.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||||||||||||||||
| 140 | 2 | my $is_native = $message->isa('Mail::Box::Maildir::Message'); | |||||||||||||||||||||||||||||||||||||||||
| 141 | 2 | my $coerced = $self->SUPER::coerce($message, @_); | |||||||||||||||||||||||||||||||||||||||||
| 142 | |||||||||||||||||||||||||||||||||||||||||||
| 143 | 2 | ▶ | my $basename = $is_native ? basename($message->filename) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$message->timestamp || time
MC/DC0%0/1
$message->timestamp || time
$message->timestamp
Truth table50%1/2
A
A= $message->timestamp
| |||||||||||||||||||||||||||||||||||||||||||
| 144 | : ($message->timestamp || time) .'.'. hostname .'.'. $uniq++; | ||||||||||||||||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||||||||||||||||
| 146 | 2 | my $dir = $self->directory; | |||||||||||||||||||||||||||||||||||||||||
| 147 | 2 | $coerced->create("$dir/tmp/$basename"); | |||||||||||||||||||||||||||||||||||||||||
| 148 | 2 | my $new = $coerced->create("$dir/new/$basename"); | |||||||||||||||||||||||||||||||||||||||||
| 149 | |||||||||||||||||||||||||||||||||||||||||||
| 150 | 2 | trace "Added Maildir message in $new"; | |||||||||||||||||||||||||||||||||||||||||
| 151 | 2 | ▶ | $coerced->labelsToFilename unless $is_native; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 152 | 2 | $coerced; | |||||||||||||||||||||||||||||||||||||||||
| 153 | } | ||||||||||||||||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||||||||||||||||
| 155 | #-------------------- | ||||||||||||||||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||||||||||||||||
| 157 | sub createDirs($) | ||||||||||||||||||||||||||||||||||||||||||
| 158 | 0 | ▶ | { my ($thing, $dir) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
createDirs: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||||||||||||||||||
| 160 | 0 | ▶ | -d $dir || mkdir $dir | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
-d $dir or mkdir $dir
MC/DC0%0/2
-d $dir or mkdir $dir
-d $dir
mkdir $dir
Truth table0%0/3
A or B
A= -d $dirB= mkdir $dir
| |||||||||||||||||||||||||||||||||||||||||||
| 161 | or fault __x"cannot create Maildir folder directory {dir}", dir => $dir; | ||||||||||||||||||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||||||||||||||||
| 163 | 0 | foreach my $sub (qw/tmp new cur/) | |||||||||||||||||||||||||||||||||||||||||
| 164 | 0 | { my $subdir = "$dir/$sub"; | |||||||||||||||||||||||||||||||||||||||||
| 165 | 0 | ▶ | -d $subdir || mkdir $subdir | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
-d $subdir or mkdir $subdir
MC/DC0%0/2
-d $subdir or mkdir $subdir
-d $subdir
mkdir $subdir
Truth table0%0/3
A or B
A= -d $subdirB= mkdir $subdir
| |||||||||||||||||||||||||||||||||||||||||||
| 166 | or fault __x"cannot create Maildir folder subdir {dir}", dir => $subdir; | ||||||||||||||||||||||||||||||||||||||||||
| 167 | } | ||||||||||||||||||||||||||||||||||||||||||
| 168 | |||||||||||||||||||||||||||||||||||||||||||
| 169 | 0 | $thing; | |||||||||||||||||||||||||||||||||||||||||
| 170 | } | ||||||||||||||||||||||||||||||||||||||||||
| 171 | |||||||||||||||||||||||||||||||||||||||||||
| 172 | |||||||||||||||||||||||||||||||||||||||||||
| 173 | sub folderIsEmpty($) | ||||||||||||||||||||||||||||||||||||||||||
| 174 | 0 | ▶ | { my ($self, $dir) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
folderIsEmpty: not called CC=9 SCAR=45.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 175 | 0 | ▶ | return 1 unless -d $dir; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 176 | |||||||||||||||||||||||||||||||||||||||||||
| 177 | 0 | foreach my $sub (qw/tmp new cur/) | |||||||||||||||||||||||||||||||||||||||||
| 178 | 0 | { my $subdir = "$dir/$sub"; | |||||||||||||||||||||||||||||||||||||||||
| 179 | 0 | ▶ | -d $subdir or next; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 180 | |||||||||||||||||||||||||||||||||||||||||||
| 181 | 0 | ▶ | opendir my $dh, $subdir or return 0; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 182 | 0 | my $first = readdir $dh; | |||||||||||||||||||||||||||||||||||||||||
| 183 | 0 | closedir $dh; | |||||||||||||||||||||||||||||||||||||||||
| 184 | |||||||||||||||||||||||||||||||||||||||||||
| 185 | 0 | ▶ | return 0 if defined $first; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 186 | } | ||||||||||||||||||||||||||||||||||||||||||
| 187 | |||||||||||||||||||||||||||||||||||||||||||
| 188 | 0 | ▶ | opendir my $dh, $dir or return 1; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 189 | 0 | ▶ | while(my $entry = readdir $dh) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 190 | 0 | ▶ | { next if $entry =~ m/^(?:tmp|cur|new|bulletin(?:time|lock)|seriallock|\..?)$/; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 191 | 0 | closedir $dh; | |||||||||||||||||||||||||||||||||||||||||
| 192 | 0 | return 0; | |||||||||||||||||||||||||||||||||||||||||
| 193 | } | ||||||||||||||||||||||||||||||||||||||||||
| 194 | |||||||||||||||||||||||||||||||||||||||||||
| 195 | 0 | closedir $dh; | |||||||||||||||||||||||||||||||||||||||||
| 196 | 0 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 197 | } | ||||||||||||||||||||||||||||||||||||||||||
| 198 | |||||||||||||||||||||||||||||||||||||||||||
| 199 | sub delete(@) | ||||||||||||||||||||||||||||||||||||||||||
| 200 | 0 | ▶ | { my $self = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
delete: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 201 | |||||||||||||||||||||||||||||||||||||||||||
| 202 | # Subfolders are not nested in the directory structure | ||||||||||||||||||||||||||||||||||||||||||
| 203 | 0 | remove \1, $self->directory; | |||||||||||||||||||||||||||||||||||||||||
| 204 | } | ||||||||||||||||||||||||||||||||||||||||||
| 205 | |||||||||||||||||||||||||||||||||||||||||||
| 206 | sub readMessageFilenames | ||||||||||||||||||||||||||||||||||||||||||
| 207 | 14 | ▶ | { my ($self, $dirname) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
readMessageFilenames: called CC=8 SCAR=25.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 208 | |||||||||||||||||||||||||||||||||||||||||||
| 209 | 14 | ▶ | opendir my $dh, $dirname or return (); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 210 | |||||||||||||||||||||||||||||||||||||||||||
| 211 | 14 | my @files; | |||||||||||||||||||||||||||||||||||||||||
| 212 | 14 | ▶ | if(${^TAINT}) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 213 | { # unsorted list of untainted filenames. | ||||||||||||||||||||||||||||||||||||||||||
| 214 | 0 | ▶ | @files = map +(m/^([0-9][\w.:,=\-]+)$/ && -f "$dirname/$1" ? $1 : ()), readdir $dh; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
/^([0-9][\w.:,=\-]+)$/ and -f "$dirname/$1"
MC/DC0%0/2
/^([0-9][\w.:,=\-]+)$/ and -f "$dirname/$1"
/^([0-9][\w.:,=\-]+)$/
-f "$dirname/$1"
Truth table0%0/3
A and B
A= /^([0-9][\w.:,=\-]+)$/B= -f "$dirname/$1"
| |||||||||||||||||||||||||||||||||||||||||||
| 215 | } | ||||||||||||||||||||||||||||||||||||||||||
| 216 | else | ||||||||||||||||||||||||||||||||||||||||||
| 217 | { # not running tainted | ||||||||||||||||||||||||||||||||||||||||||
| 218 | 14 | ▶ | @files = grep m/^([0-9][\w.:,=\-]+)$/ && -f "$dirname/$1", readdir $dh; | ||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
/^([0-9][\w.:,=\-]+)$/ && -f "$dirname/$1"
MC/DC50%1/2
/^([0-9][\w.:,=\-]+)$/ && -f "$dirname/$1"
/^([0-9][\w.:,=\-]+)$/
-f "$dirname/$1"
Truth table66%2/3
A && B
A= /^([0-9][\w.:,=\-]+)$/B= -f "$dirname/$1"
| |||||||||||||||||||||||||||||||||||||||||||
| 219 | } | ||||||||||||||||||||||||||||||||||||||||||
| 220 | 14 | closedir $dh; | |||||||||||||||||||||||||||||||||||||||||
| 221 | |||||||||||||||||||||||||||||||||||||||||||
| 222 | # Sort the names. Solve the Y2K (actually the 1 billion seconds | ||||||||||||||||||||||||||||||||||||||||||
| 223 | # since 1970 bug) which hunts Maildir. The timestamp, which is | ||||||||||||||||||||||||||||||||||||||||||
| 224 | # the start of the filename will have some 0's in front, so each | ||||||||||||||||||||||||||||||||||||||||||
| 225 | # timestamp has the same length. | ||||||||||||||||||||||||||||||||||||||||||
| 226 | |||||||||||||||||||||||||||||||||||||||||||
| 227 | 14 | my %unified; | |||||||||||||||||||||||||||||||||||||||||
| 228 | m/^(\d+)/ and $unified{ ('0' x (10-length($1))).$_ } = $_ | ||||||||||||||||||||||||||||||||||||||||||
| 229 | 14 | ▶ | for @files; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 230 | |||||||||||||||||||||||||||||||||||||||||||
| 231 | 14 | map "$dirname/$unified{$_}", sort keys %unified; | |||||||||||||||||||||||||||||||||||||||||
| 232 | } | ||||||||||||||||||||||||||||||||||||||||||
| 233 | |||||||||||||||||||||||||||||||||||||||||||
| 234 | sub readMessages(@) | ||||||||||||||||||||||||||||||||||||||||||
| 235 | 7 | ▶ | { my ($self, %args) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
readMessages: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 236 | |||||||||||||||||||||||||||||||||||||||||||
| 237 | 7 | my $directory = $self->directory; | |||||||||||||||||||||||||||||||||||||||||
| 238 | 7 | ▶ | -d $directory or return; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 239 | |||||||||||||||||||||||||||||||||||||||||||
| 240 | # | ||||||||||||||||||||||||||||||||||||||||||
| 241 | # Read all messages | ||||||||||||||||||||||||||||||||||||||||||
| 242 | # | ||||||||||||||||||||||||||||||||||||||||||
| 243 | |||||||||||||||||||||||||||||||||||||||||||
| 244 | 7 | my $curdir = "$directory/cur"; | |||||||||||||||||||||||||||||||||||||||||
| 245 | 7 | my @cur = map +[$_, 1], $self->readMessageFilenames($curdir); | |||||||||||||||||||||||||||||||||||||||||
| 246 | |||||||||||||||||||||||||||||||||||||||||||
| 247 | 7 | my $newdir = "$directory/new"; | |||||||||||||||||||||||||||||||||||||||||
| 248 | 7 | my @new = map +[$_, 0], $self->readMessageFilenames($newdir); | |||||||||||||||||||||||||||||||||||||||||
| 249 | |||||||||||||||||||||||||||||||||||||||||||
| 250 | 7 | foreach (@cur, @new) | |||||||||||||||||||||||||||||||||||||||||
| 251 | 303 | { my ($filename, $accepted) = @$_; | |||||||||||||||||||||||||||||||||||||||||
| 252 | my $message = $args{message_type}->new( | ||||||||||||||||||||||||||||||||||||||||||
| 253 | head => $args{head_delayed_type}->new, | ||||||||||||||||||||||||||||||||||||||||||
| 254 | 303 | filename => $filename, | |||||||||||||||||||||||||||||||||||||||||
| 255 | folder => $self, | ||||||||||||||||||||||||||||||||||||||||||
| 256 | fix_header=> $self->fixHeaders, | ||||||||||||||||||||||||||||||||||||||||||
| 257 | labels => [ accepted => $accepted ], | ||||||||||||||||||||||||||||||||||||||||||
| 258 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 259 | |||||||||||||||||||||||||||||||||||||||||||
| 260 | 303 | my $body = $args{body_delayed_type}->new(message => $message); | |||||||||||||||||||||||||||||||||||||||||
| 261 | 303 | ▶ | $message->storeBody($body) if $body; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 262 | 303 | $self->storeMessage($message); | |||||||||||||||||||||||||||||||||||||||||
| 263 | } | ||||||||||||||||||||||||||||||||||||||||||
| 264 | |||||||||||||||||||||||||||||||||||||||||||
| 265 | 7 | $self; | |||||||||||||||||||||||||||||||||||||||||
| 266 | } | ||||||||||||||||||||||||||||||||||||||||||
| 267 | |||||||||||||||||||||||||||||||||||||||||||
| 268 | |||||||||||||||||||||||||||||||||||||||||||
| 269 | sub acceptMessages($) | ||||||||||||||||||||||||||||||||||||||||||
| 270 | 0 | ▶ | { my ($self, %args) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
acceptMessages: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 271 | 0 | my @accept = $self->messages('!accepted'); | |||||||||||||||||||||||||||||||||||||||||
| 272 | 0 | $_->accept foreach @accept; | |||||||||||||||||||||||||||||||||||||||||
| 273 | 0 | @accept; | |||||||||||||||||||||||||||||||||||||||||
| 274 | } | ||||||||||||||||||||||||||||||||||||||||||
| 275 | |||||||||||||||||||||||||||||||||||||||||||
| 276 | |||||||||||||||||||||||||||||||||||||||||||
| 277 | sub writeMessages($) | ||||||||||||||||||||||||||||||||||||||||||
| 278 | 5 | ▶ | { my ($self, $args) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
writeMessages: called CC=9 SCAR=24.3
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 279 | |||||||||||||||||||||||||||||||||||||||||||
| 280 | # Write each message. Two things complicate life: | ||||||||||||||||||||||||||||||||||||||||||
| 281 | # 1 - we may have a huge folder, which should not be on disk twice | ||||||||||||||||||||||||||||||||||||||||||
| 282 | # 2 - we may have to replace a message, but it is unacceptable | ||||||||||||||||||||||||||||||||||||||||||
| 283 | # to remove the original before we are sure that the new version | ||||||||||||||||||||||||||||||||||||||||||
| 284 | # is on disk. | ||||||||||||||||||||||||||||||||||||||||||
| 285 | |||||||||||||||||||||||||||||||||||||||||||
| 286 | 5 | my $writer = 0; | |||||||||||||||||||||||||||||||||||||||||
| 287 | |||||||||||||||||||||||||||||||||||||||||||
| 288 | 5 | my $directory = $self->directory; | |||||||||||||||||||||||||||||||||||||||||
| 289 | 5 | my @messages = @{$args->{messages}}; | |||||||||||||||||||||||||||||||||||||||||
| 290 | |||||||||||||||||||||||||||||||||||||||||||
| 291 | 5 | my $tmpdir = "$directory/tmp"; | |||||||||||||||||||||||||||||||||||||||||
| 292 | 5 | ▶ | -d $tmpdir || mkdir $tmpdir | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
-d $tmpdir or mkdir $tmpdir
MC/DC0%0/2
-d $tmpdir or mkdir $tmpdir
-d $tmpdir
mkdir $tmpdir
Truth table33%1/3
A or B
A= -d $tmpdirB= mkdir $tmpdir
| |||||||||||||||||||||||||||||||||||||||||||
| 293 | or fault __x"cannot create directory {dir}", dir => $tmpdir; | ||||||||||||||||||||||||||||||||||||||||||
| 294 | |||||||||||||||||||||||||||||||||||||||||||
| 295 | 5 | foreach my $message (@messages) | |||||||||||||||||||||||||||||||||||||||||
| 296 | 192 | ▶ | { $message->isModified or next; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 297 | |||||||||||||||||||||||||||||||||||||||||||
| 298 | 1 | my $filename = $message->filename; | |||||||||||||||||||||||||||||||||||||||||
| 299 | 1 | my $basename = basename $filename; | |||||||||||||||||||||||||||||||||||||||||
| 300 | |||||||||||||||||||||||||||||||||||||||||||
| 301 | 1 | my $newtmp = "$directory/tmp/$basename"; | |||||||||||||||||||||||||||||||||||||||||
| 302 | 1 | ▶ | open my $new, '>:raw', $newtmp | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 303 | or fault __x"cannot create file {file}", file => $newtmp; | ||||||||||||||||||||||||||||||||||||||||||
| 304 | |||||||||||||||||||||||||||||||||||||||||||
| 305 | 1 | $message->write($new); | |||||||||||||||||||||||||||||||||||||||||
| 306 | 1 | close $new; | |||||||||||||||||||||||||||||||||||||||||
| 307 | |||||||||||||||||||||||||||||||||||||||||||
| 308 | 1 | unlink $filename; | |||||||||||||||||||||||||||||||||||||||||
| 309 | 1 | ▶ | move $newtmp, $filename | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 310 | or fault __x"cannot rename {from} to {to}", from => $newtmp, to => $filename; | ||||||||||||||||||||||||||||||||||||||||||
| 311 | } | ||||||||||||||||||||||||||||||||||||||||||
| 312 | |||||||||||||||||||||||||||||||||||||||||||
| 313 | # Remove an empty folder. This is done last, because the code before | ||||||||||||||||||||||||||||||||||||||||||
| 314 | # in this method will have cleared the contents of the directory. | ||||||||||||||||||||||||||||||||||||||||||
| 315 | |||||||||||||||||||||||||||||||||||||||||||
| 316 | 5 | ▶ | if(!@messages && $self->removeEmpty) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
not @messages and $self->removeEmpty
MC/DC0%0/2
not @messages and $self->removeEmpty
not @messages
$self->removeEmpty
Truth table33%1/3
not(A) and B
A= not @messagesB= $self->removeEmpty
| |||||||||||||||||||||||||||||||||||||||||||
| 317 | { # If something is still in the directory, this will fail, but I | ||||||||||||||||||||||||||||||||||||||||||
| 318 | # don't mind. | ||||||||||||||||||||||||||||||||||||||||||
| 319 | 0 | rmdir "$directory/cur"; | |||||||||||||||||||||||||||||||||||||||||
| 320 | 0 | rmdir "$directory/tmp"; | |||||||||||||||||||||||||||||||||||||||||
| 321 | 0 | rmdir "$directory/new"; | |||||||||||||||||||||||||||||||||||||||||
| 322 | 0 | rmdir $directory; | |||||||||||||||||||||||||||||||||||||||||
| 323 | } | ||||||||||||||||||||||||||||||||||||||||||
| 324 | |||||||||||||||||||||||||||||||||||||||||||
| 325 | 5 | $self; | |||||||||||||||||||||||||||||||||||||||||
| 326 | } | ||||||||||||||||||||||||||||||||||||||||||
| 327 | |||||||||||||||||||||||||||||||||||||||||||
| 328 | |||||||||||||||||||||||||||||||||||||||||||
| 329 | sub appendMessages(@) | ||||||||||||||||||||||||||||||||||||||||||
| 330 | 1 | ▶ | { my $class = shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
appendMessages: called CC=10 SCAR=25.3
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 331 | 1 | my %args = @_; | |||||||||||||||||||||||||||||||||||||||||
| 332 | |||||||||||||||||||||||||||||||||||||||||||
| 333 | my @messages | ||||||||||||||||||||||||||||||||||||||||||
| 334 | = exists $args{message} ? $args{message} | ||||||||||||||||||||||||||||||||||||||||||
| 335 | 1 | ▶ | : exists $args{messages} ? @{$args{messages}} | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 336 | : return (); | ||||||||||||||||||||||||||||||||||||||||||
| 337 | |||||||||||||||||||||||||||||||||||||||||||
| 338 | 1 | my $self = $class->new(@_, access => 'a'); | |||||||||||||||||||||||||||||||||||||||||
| 339 | 1 | my $directory= $self->directory; | |||||||||||||||||||||||||||||||||||||||||
| 340 | 1 | ▶ | -d $directory or return; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 341 | |||||||||||||||||||||||||||||||||||||||||||
| 342 | 1 | my $tmpdir = "$directory/tmp"; | |||||||||||||||||||||||||||||||||||||||||
| 343 | 1 | ▶ | -d $tmpdir || mkdir $tmpdir | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
-d $tmpdir or mkdir $tmpdir
MC/DC0%0/2
-d $tmpdir or mkdir $tmpdir
-d $tmpdir
mkdir $tmpdir
Truth table33%1/3
A or B
A= -d $tmpdirB= mkdir $tmpdir
| |||||||||||||||||||||||||||||||||||||||||||
| 344 | or fault __x"cannot create directory {dir}", dir => $tmpdir; | ||||||||||||||||||||||||||||||||||||||||||
| 345 | |||||||||||||||||||||||||||||||||||||||||||
| 346 | 1 | ▶ | my $msgtype = $args{message_type} || 'Mail::Box::Maildir::Message'; | ||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$args{'message_type'} || 'Mail::Box::Maildir::Message'
MC/DC0%0/1
$args{'message_type'} || 'Mail::Box::Maildir::Message'
$args{'message_type'}
Truth table50%1/2
A
A= $args{'message_type'}
| |||||||||||||||||||||||||||||||||||||||||||
| 347 | |||||||||||||||||||||||||||||||||||||||||||
| 348 | 1 | foreach my $message (@messages) | |||||||||||||||||||||||||||||||||||||||||
| 349 | 1 | { my $is_native = $message->isa($msgtype); | |||||||||||||||||||||||||||||||||||||||||
| 350 | 1 | my ($basename, $coerced); | |||||||||||||||||||||||||||||||||||||||||
| 351 | |||||||||||||||||||||||||||||||||||||||||||
| 352 | 1 | ▶ | if($is_native) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 353 | 1 | { $coerced = $message; | |||||||||||||||||||||||||||||||||||||||||
| 354 | 1 | $basename = basename $message->filename; | |||||||||||||||||||||||||||||||||||||||||
| 355 | } | ||||||||||||||||||||||||||||||||||||||||||
| 356 | else | ||||||||||||||||||||||||||||||||||||||||||
| 357 | 0 | { $coerced = $self->SUPER::coerce($message); | |||||||||||||||||||||||||||||||||||||||||
| 358 | 0 | ▶ | $basename = ($message->timestamp||time).'.'. hostname.'.'.$uniq++; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$message->timestamp || time
MC/DC0%0/1
$message->timestamp || time
$message->timestamp
Truth table0%0/2
A
A= $message->timestamp
| |||||||||||||||||||||||||||||||||||||||||||
| 359 | } | ||||||||||||||||||||||||||||||||||||||||||
| 360 | |||||||||||||||||||||||||||||||||||||||||||
| 361 | 1 | my $dir = $self->directory; | |||||||||||||||||||||||||||||||||||||||||
| 362 | 1 | $coerced->create("$dir/tmp/$basename"); | |||||||||||||||||||||||||||||||||||||||||
| 363 | 1 | my $new = $coerced->create("$dir/new/$basename"); | |||||||||||||||||||||||||||||||||||||||||
| 364 | 1 | trace "Appended Maildir message in $new"; | |||||||||||||||||||||||||||||||||||||||||
| 365 | } | ||||||||||||||||||||||||||||||||||||||||||
| 366 | |||||||||||||||||||||||||||||||||||||||||||
| 367 | 1 | $self->close; | |||||||||||||||||||||||||||||||||||||||||
| 368 | 1 | @messages; | |||||||||||||||||||||||||||||||||||||||||
| 369 | } | ||||||||||||||||||||||||||||||||||||||||||
| 370 | |||||||||||||||||||||||||||||||||||||||||||
| 371 | #-------------------- | ||||||||||||||||||||||||||||||||||||||||||
| 372 | |||||||||||||||||||||||||||||||||||||||||||
| 373 | 6 | 1; | |||||||||||||||||||||||||||||||||||||||||