Branch Coverage

blib/lib/Mail/Milter/Authentication.pm
Criterion Covered Total %
branch 102 210 48.5


line true false branch
33 30679 35 if $LOGGER
42 0 35 if (exists $config->{'log_dispatchouli'})
56 0 31908 if $part eq ''
72 0 1652 unless -e $file
76 1409 243 if (not &is_loaded($module)) { }
95 0 0 unless -e $file
107 0 0 $priority == 4 ? :
0 0 $priority == 3 ? :
111 0 $priority == 2 ? :
56 111 $priority == 1 ? :
9 167 $priority == 0 ? :
140 60 202 if ($object->can('pre_loop_setup'))
143 262 0 if ($object->can('register_metrics'))
156 16 12 if ($config->{'protocol'} eq 'milter') { }
12 0 elsif ($config->{'protocol'} eq 'smtp') { }
166 28 0 if ($config->{'error_log'})
167 0 28 unless open STDERR, '>>', $config->{'error_log'}
168 0 28 unless open STDOUT, '>>', $config->{'error_log'}
185 24 240 if ($object->can('pre_fork_setup'))
202 19 0 if ($config->{'error_log'})
204 0 19 unless open STDERR, '>>', $config->{'error_log'}
205 0 19 unless open STDOUT, '>>', $config->{'error_log'}
207 0 19 if (my $error = $@)
216 11 8 if ($config->{'protocol'} eq 'milter') { }
8 0 elsif ($config->{'protocol'} eq 'smtp') { }
228 11 8 if ($config->{'protocol'} eq 'milter')
285 0 200 if ($socket->isa('Net::Server::Proto'))
287 0 0 if $proto =~ /^UNIX/
291 0 200 if ($socket->isa('IO::Socket::INET'))
295 0 200 if ($socket->isa('IO::Socket::INET6'))
299 200 0 if ($socket->isa('IO::Socket::UNIX'))
333 0 135 if ($proto eq 'tcp') { }
135 0 elsif ($proto eq 'unix') { }
351 65 0 if (defined $config->{'metric_connection'})
364 0 65 if (defined $config->{'metric_port'} and $self->get_client_proto eq 'TCP' and $self->get_client_port eq $config->{'metric_port'}) { }
0 65 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) { }
9 56 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) { }
401 1 55 if ($self->{'handler'}{'_Handler'}{'exit_on_close'})
405 55 0 if ($config->{'debug'})
408 55 715 if ($process->pid == $Mail::Milter::Authentication::PID)
430 0 0 unless ($pid_file)
433 0 0 unless (-e $pid_file)
447 0 0 if ($process->pid == $self_pid)
448 0 0 if ($process->cmndline eq $Mail::Milter::Authentication::Config::IDENT . ':control')
452 0 0 if ($process->pid == $pid)
454 0 0 if ($process->cmndline eq $Mail::Milter::Authentication::Config::IDENT . ':master')
463 0 0 unless ($found_self)
464 0 0 if ($found_pid)
476 0 0 if ($process->cmndline eq $Mail::Milter::Authentication::Config::IDENT . ':master')
492 0 0 if ($command eq 'stop') { }
0 0 elsif ($command eq 'restart' or $command eq 'start') { }
0 0 elsif ($command eq 'status') { }
494 0 0 if ($pid) { }
504 0 0 if ($pid) { }
519 0 0 if ($pid) { }
521 0 0 unless (get_valid_pid($pid_file))
566 28 0 if ($config->{'error_log'})
567 0 28 unless open STDERR, '>>', $config->{'error_log'}
568 0 28 unless open STDOUT, '>>', $config->{'error_log'}
571 0 28 if ($args->{'daemon'})
572 0 0 if ($Mail::Milter::Authentication::EUID == 0) { }
595 28 0 if ($Mail::Milter::Authentication::EUID == 0) { }
598 0 28 if ($user and $group) { }
607 28 0 if ($config->{'error_log'})
608 0 28 unless (-e $config->{'error_log'})
612 0 28 if ($user)
617 0 28 if (exists $config->{'chroot'})
628 0 28 if (exists $config->{'connections'})
646 0 28 if ($type eq 'inet') { }
28 0 elsif ($type eq 'unix') { }
675 28 0 if ($umask)
686 28 0 if (defined $config->{'metric_connection'}) { }
0 0 elsif (defined $config->{'metric_port'}) { }
694 0 28 if ($type eq 'inet') { }
28 0 elsif ($type eq 'unix') { }
725 28 0 if ($umask)
735 0 28 if (defined $config->{'metric_port'})
771 13 0 if ($Mail::Milter::Authentication::PID != $parent_pid)
775 0 0 unless $error
778 0 0 if (scalar @start_times >= 4)
779 0 0 if ($start_times[3] > time - 120)
807 0 0 if ($ppid == $Mail::Milter::Authentication::PID) { }
843 270 8 unless (&is_loaded($package))
846 0 270 if (my $error = $@)
865 746 1546 if ($object->can($callback . '_callback'))
888 249 497 unless (exists $self->{'callbacks'}{$callback})
908 87 249 unless (exists $self->{'callbacks'}{$callback})
912 336 0 if (not exists $self->{'callbacks_list'}{$callback}) { }
933 51 695 if ($handler->can($requires_method))
943 0 746 if ($handler->can($requires_method))
957 51 102 unless (exists $added->{$require})
961 746 34 if ($requires_met == 1) { }
971 0 283 if ($defer_count == $todo_count)
987 18 0 if ($handler)
1010 447 5391 if (exists $self->{'smtp'}) { }
3110 2281 elsif (exists $self->{'handler'}{'_Handler'}) { }
1011 447 0 if ($self->{'smtp'}{'queue_id'})
1038 0 1906 if ($self->{'extra_debugging'})
1048 0 1 if (my $queue_id = $self->get_queue_id)
1051 1 0 if $config->{'logtoerr'}
1060 6 145 if (my $queue_id = $self->get_queue_id)
1063 151 0 if $config->{'logtoerr'}
1072 921 4765 if (my $queue_id = $self->get_queue_id)
1075 5686 0 if ($config->{'debug'})
1076 5686 0 if $config->{'logtoerr'}