Branch Coverage

blib/lib/Mail/Milter/Authentication.pm
Criterion Covered Total %
branch 115 234 49.1


line true false branch
28 13935 48 if $LOGGER
37 0 48 if (exists $config->{'log_dispatchouli'})
50 0 15106 if $part eq ""
63 0 2294 unless -e $file
67 1942 352 if (not &is_loaded($module)) { }
85 0 0 unless -e $file
96 0 0 $priority == 4 ? :
0 0 $priority == 3 ? :
144 0 $priority == 2 ? :
74 144 $priority == 1 ? :
11 218 $priority == 0 ? :
125 74 259 if ($object->can("pre_loop_setup"))
128 333 0 if ($object->can("register_metrics"))
142 20 17 if ($config->{'protocol'} eq 'milter') { }
17 0 elsif ($config->{'protocol'} eq 'smtp') { }
152 37 0 if ($config->{'error_log'})
153 0 37 unless open STDERR, ">>", $config->{'error_log'}
154 0 37 unless open STDOUT, ">>", $config->{'error_log'}
168 33 302 if ($object->can("pre_fork_setup"))
183 26 0 if ($config->{'error_log'})
185 0 26 unless open STDERR, ">>", $config->{'error_log'}
186 0 26 unless open STDOUT, ">>", $config->{'error_log'}
188 0 26 if (my $error = $@)
193 23 3 unless defined $arg
194 3 23 if ($arg eq 'dequeue') { }
204 14 12 if ($config->{'protocol'} eq 'milter') { }
12 0 elsif ($config->{'protocol'} eq 'smtp') { }
216 14 12 if ($config->{'protocol'} eq "milter")
249 23 3 unless $arg eq "dequeue"
258 22 3 unless defined $arg
259 3 22 if ($arg eq 'dequeue') { }
288 0 244 if ($socket->isa("Net::Server::Proto"))
290 0 0 if $proto =~ /^UNIX/u
294 0 244 if ($socket->isa("IO::Socket::IP"))
298 0 244 if ($socket->isa("IO::Socket::INET"))
302 0 244 if ($socket->isa("IO::Socket::INET6"))
306 244 0 if ($socket->isa("IO::Socket::UNIX"))
334 0 163 if ($proto eq 'tcp') { }
163 0 elsif ($proto eq 'unix') { }
350 81 0 if (defined $config->{'metric_connection'})
363 0 81 if (defined $config->{'metric_port'} and $self->get_client_proto eq 'TCP' and $self->get_client_port eq $config->{'metric_port'}) { }
0 81 elsif (defined $config->{'metric_connection'} and $metric_type eq 'inet' and $self->get_client_proto eq 'TCP' and $self->get_client_port eq $metric_path) { }
11 70 elsif (defined $config->{'metric_connection'} and $metric_type eq 'unix' and $self->get_client_proto eq 'UNIX' and $self->get_client_path eq $metric_path) { }
399 1 69 if ($self->{'handler'}{'_Handler'}{'exit_on_close'})
407 0 69 if ($config->{'debug'})
410 0 0 if ($process->pid == $Mail::Milter::Authentication::PID)
430 0 1 if ($self->{'handler'}{'_Handler'}{'suppress_error_emails'})
452 0 0 unless $process->pid == $ppid or $process->ppid == $ppid
496 0 0 unless $process->pid == $Mail::Milter::Authentication::PID or $process->ppid == $Mail::Milter::Authentication::PID
525 0 0 unless ($pid_file)
528 0 0 unless (-e $pid_file)
542 0 0 if ($process->pid == $self_pid)
543 0 0 if ($process->cmndline eq $Mail::Milter::Authentication::Config::IDENT . ":control")
547 0 0 if ($process->pid == $pid)
549 0 0 if ($process->cmndline eq $Mail::Milter::Authentication::Config::IDENT . ":parent")
558 0 0 unless ($found_self)
559 0 0 if ($found_pid)
571 0 0 if ($process->cmndline eq $Mail::Milter::Authentication::Config::IDENT . ":master")
574 0 0 if ($process->cmndline eq $Mail::Milter::Authentication::Config::IDENT . ":parent")
589 0 0 if ($command eq 'stop') { }
0 0 elsif ($command eq 'restart' or $command eq 'start') { }
0 0 elsif ($command eq 'status') { }
591 0 0 if ($pid) { }
601 0 0 if ($pid) { }
616 0 0 if ($pid) { }
618 0 0 if (not get_valid_pid($pid_file))
660 37 0 if ($config->{'error_log'})
661 0 37 unless open STDERR, ">>", $config->{'error_log'}
662 0 37 unless open STDOUT, ">>", $config->{'error_log'}
665 0 37 if ($args->{'daemon'})
666 0 0 if ($Mail::Milter::Authentication::EUID == 0) { }
689 0 37 if $config->{'lock_file'}
691 37 0 if ($Mail::Milter::Authentication::EUID == 0) { }
694 0 37 if ($user and $group) { }
703 37 0 if ($config->{'error_log'})
704 0 37 unless (-e $config->{'error_log'})
708 0 37 if ($user)
713 0 37 if (exists $config->{'chroot'})
724 0 37 if (exists $config->{'connections'})
742 0 37 if ($type eq 'inet') { }
37 0 elsif ($type eq 'unix') { }
771 37 0 if ($umask)
782 37 0 if (defined $config->{'metric_connection'}) { }
0 0 elsif (defined $config->{'metric_port'}) { }
790 0 37 if ($type eq 'inet') { }
37 0 elsif ($type eq 'unix') { }
819 37 0 if ($umask)
829 0 37 if (defined $config->{'metric_port'})
850 0 37 if ($config->{'patch_net_server'} and scalar @ports == 1)
873 1 0 if ($Mail::Milter::Authentication::PID != $parent_pid)
877 0 0 unless $error
886 0 0 if (scalar @start_times >= 4)
887 0 0 if ($start_times[3] > time - 120)
913 0 0 if ($ppid == $Mail::Milter::Authentication::PID) { }
942 337 31 if (not &is_loaded($package))
945 0 337 if (my $error = $@)
961 1178 2588 if ($object->can($callback . "_callback"))
980 443 735 unless (exists $self->{'callbacks'}{$callback})
995 173 443 unless (exists $self->{'callbacks'}{$callback})
999 616 0 if (not exists $self->{'callbacks_list'}{$callback}) { }
1020 76 1102 if ($handler->can($requires_method))
1030 0 1178 if ($handler->can($requires_method))
1044 71 98 unless (exists $added->{$require})
1048 1178 51 if ($requires_met == 1) { }
1058 0 492 if ($defer_count == $todo_count)
1072 25 0 if ($handler)
1093 538 7397 if (exists $self->{'smtp'}) { }
4243 3154 elsif (exists $self->{'handler'}{'_Handler'}) { }
1094 538 0 if ($self->{'smtp'}{'queue_id'})
1118 0 2598 if ($self->{'extra_debugging'})
1126 0 1 if (my $queue_id = $self->get_queue_id)
1129 1 0 if $config->{'logtoerr'}
1136 9 115 if (my $queue_id = $self->get_queue_id)
1139 124 0 if $config->{'logtoerr'}
1146 1140 6670 if (my $queue_id = $self->get_queue_id)
1149 289 7521 if ($config->{'debug'})
1150 289 0 if $config->{'logtoerr'}