Branch Coverage

lib/Mail/Toaster/Setup.pm
Criterion Covered Total %
branch 68 1096 6.2


line true false branch
24 2 1 if defined $p{'test_ok'}
26 1 0 unless (my $ver = $self->conf->{'install_autorespond'})
31 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'freebsd' and $ver eq 'port')
38 0 0 if ($autorespond and -x $autorespond)
43 0 0 if ($ver eq 'port')
51 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'darwin' or $Mail::Toaster::Setup::OSNAME eq 'freebsd')
72 0 0 if ($self->util->find_bin('autorespond', 'fatal', 0, 'verbose', 0))
84 2 1 if defined $p{'test_ok'}
90 1 0 unless (my $ver = $self->conf->{'install_clamav'})
98 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'freebsd' and $ver eq 'port')
104 0 0 unless (getpwuid $clamuser)
109 0 0 unless (getpwnam $clamuser)
115 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'darwin' and $ver eq 'port')
116 0 0 unless $self->darwin->install_port('clamav')
123 0 0 if ($ver eq '1')
135 0 0 unless $self->util->find_bin('clamdscan', 'fatal', 0)
147 0 0 unless $self->clamav_update
148 0 0 unless $self->clamav_perms
149 0 0 unless $self->clamav_start
165 0 0 if (-e $file)
171 0 0 unless $self->util->syscmd('pw user mod clamav -G qmail')
182 0 0 if ($self->util->is_process_running('clamd'))
188 0 0 if ($Mail::Toaster::Setup::OSNAME ne 'freebsd')
210 0 0 unless -x $start
212 0 0 if (-x $start) { }
223 0 0 unless -x $start
226 0 0 if ($self->util->is_process_running('clamd', 'verbose', 0))
233 0 0 if -e "/usr/local/etc/rc.d/$_"
245 0 0 unless (-e $logfile)
251 0 0 unless my $freshclam = $self->util->find_bin('freshclam', 'verbose', 0)
268 2 1 if defined $p{'test_ok'}
270 1 0 unless (my $ver = $self->conf->{'install_courier_imap'})
272 0 1 if $Mail::Toaster::Setup::OSNAME eq 'freebsd'
278 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'freebsd' and $ver eq 'port') { }
0 0 elsif ($Mail::Toaster::Setup::OSNAME eq 'darwin') { }
283 0 0 if $self->freebsd->is_port_installed('courier-imap', 'verbose', 0)
291 0 0 if $ver eq 'port'
353 0 0 if ($Mail::Toaster::Setup::OSNAME ne 'freebsd')
358 0 0 unless ($self->freebsd->is_port_installed('courier-authlib'))
381 0 0 unless (-e $authrc)
382 0 0 if (-e "$authrc.dist")
388 0 0 if (`grep 'authmodulelist=' $authrc | grep ldap`)
405 0 0 unless (-e '/var/run/authdaemond/pid')
408 0 0 if -x $_
422 0 0 unless (-e "$share/pop3d.pem" and -e "$share/imapd.pem")
445 0 0 if -f $crt and not -e $courier_pem
449 0 0 unless (-e "$share/pop3d.pem")
454 0 0 if (not -e "$share/imapd.pem")
469 0 0 unless chdir "$confdir/courier-imap"
472 0 0 unless -e 'pop3d.cnf'
473 0 0 unless -e 'pop3d'
474 0 0 unless -e 'pop3d-ssl'
475 0 0 unless -e 'imapd.cnf'
476 0 0 unless -e 'imapd'
477 0 0 unless -e 'imapd-ssl'
478 0 0 unless -e 'quotawarnmsg'
482 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'freebsd' and $ver eq 'port') { }
487 0 0 if (-e "$libe/imapd.rc") { }
502 0 0 unless (-e '/var/run/imapd-ssl.pid')
503 0 0 if -x "$prefix/sbin/imapssl"
507 0 0 unless (-e '/var/run/imapd.pid')
508 0 0 if -x "$prefix/sbin/imapssl"
512 0 0 unless (-e '/var/run/pop3d-ssl.pid')
513 0 0 if -x "$prefix/sbin/pop3ssl"
517 0 0 if ($self->conf->{'pop3_daemon'} eq 'courier')
518 0 0 if (not -e '/var/run/pop3d.pid')
519 0 0 if -x "$prefix/sbin/pop3"
531 0 0 unless $self->freebsd->is_port_installed('courier-imap')
535 0 0 if (-e "$prefix/sbin/$_")
536 0 0 unless readlink "$prefix/sbin/$_"
540 0 0 unless (-e "$prefix/sbin/imap")
548 0 0 $self->conf->{'install_courier_imap'} ? :
575 0 0 if ($self->conf->{'pop3_daemon'} eq 'courier') { }
593 2 1 if defined $p{'test_ok'}
595 1 0 unless (my $ver = $self->conf->{'install_cronolog'})
600 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'freebsd' and $ver eq 'port')
604 0 0 if ($self->util->find_bin('cronolog', 'fatal', 0))
611 0 0 if ($ver eq 'port')
621 0 0 unless $self->util->find_bin('cronolog')
630 0 0 if $self->freebsd->is_port_installed('cronolog')
645 2 1 if defined $p{'test_ok'}
647 1 0 unless (my $ver = $self->conf->{'install_daemontools'})
652 0 0 if $Mail::Toaster::Setup::OSNAME eq 'freebsd'
654 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'darwin' and $ver eq 'port')
663 0 0 if ($self->util->find_bin('svscan', 'fatal', 0, 'verbose', 0))
675 0 0 if $ver eq 'port'
684 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'darwin') { }
0 0 elsif ($Mail::Toaster::Setup::OSNAME eq 'linux') { }
0 0 elsif ($Mail::Toaster::Setup::OSNAME eq 'freebsd') { }
717 0 0 if ($Mail::Toaster::Setup::OSNAME =~ /darwin|freebsd/i)
765 2 0 if defined $p{'test_ok'}
769 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'freebsd') { }
0 0 elsif ($Mail::Toaster::Setup::OSNAME eq 'darwin') { }
776 0 0 if $self->conf->{'install_maildrop'}
777 0 0 if $self->conf->{'install_openldap_client'}
778 0 0 if $self->conf->{'install_gnupg'}
791 0 0 if $self->conf->{'install_quota_tools'}
795 0 0 if $self->conf->{'install_qmail_deliverable'}
797 0 0 unless (-x "$qmaildir/bin/qmail-queue")
813 0 0 if $self->conf->{'pop3_ssl_daemon'} eq 'qpop3d'
821 0 0 if $self->conf->{'install_quota_tools'}
834 0 0 if $self->conf->{'install_openldap_client'}
842 0 0 if $self->conf->{'install_qmail_notify'}
845 0 0 if ($package eq 'packages')
858 0 0 defined $port->{'flags'} ? :
0 0 defined $port->{'options'} ? :
0 0 defined $port->{'check'} ? :
0 0 defined $port->{'fatal'} ? :
0 0 defined $port->{'category'} ? :
867 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'linux')
878 0 0 if $self->conf->{'install_quota_tools'}
879 0 0 if $self->conf->{'install_gnupg'}
882 0 0 if ($self->util->find_bin($_, 'verbose', 0, 'fatal', 0)) { }
895 2 1 if defined $p{'test_ok'}
897 1 0 unless ($self->conf->{'install_djbdns'})
905 0 0 if $self->util->find_bin('tinydns', 'fatal', 0)
908 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'freebsd')
911 0 0 if $self->util->find_bin('tinydns', 'fatal', 0)
923 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'linux')
958 0 0 unless (-f 'README' or -f 'lib/toaster.conf.pod')
994 0 0 if ($module =~ /\AToaster\z/)
1015 0 0 if defined $p{'test_ok'}
1017 0 0 unless ($self->conf->{'qmail_domainkeys'})
1023 0 0 if (-f '/usr/local/include/domainkeys.h')
1028 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'freebsd')
1032 0 0 if (-f '/usr/local/include/domainkeys.h')
1040 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'linux')
1057 2 1 if defined $p{'test_ok'}
1059 1 0 unless (my $ver = $self->conf->{'install_dovecot'})
1064 0 0 if ($ver eq 'port' or $ver eq '1')
1066 0 0 if ($self->util->find_bin('dovecot', 'fatal', 0))
1073 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'freebsd') { }
0 0 elsif ($Mail::Toaster::Setup::OSNAME eq 'darwin') { }
1074 0 0 unless $self->dovecot_install_freebsd
1078 0 0 if $self->darwin->install_port('dovecot')
1081 0 0 if ($self->util->find_bin('dovecot', 'fatal', 0))
1090 0 0 if (-x $dovecot)
1093 0 0 if ($ver eq $installed)
1118 0 0 unless (-f $dconf)
1121 0 0 if -e $dconf
1123 0 0 unless (-f $dconf)
1129 0 0 if ($updated)
1230 0 0 unless -d $dconf
1232 0 0 unless (-f "$dconf/dovecot.conf")
1236 0 0 if (-f "$ex/$_")
1244 0 0 if ($updated)
1364 0 0 if $self->freebsd->is_port_installed('dovecot')
1368 0 0 unless $self->freebsd->install_port('dovecot', 'options', "# This file is generated by Mail Toaster.\n# Options for dovecot-1.2.17\n_OPTIONS_READ=dovecot-1.2.17\n_FILE_COMPLETE_OPTIONS_LIST=BDB GSSAPI KQUEUE LDAP MANAGESIEVE MYSQL PGSQL SQLITE SSL VPOPMAIL\nOPTIONS_FILE_UNSET+=BDB\nOPTIONS_FILE_UNSET+=GSSAPI\nOPTIONS_FILE_SET+=KQUEUE\nOPTIONS_FILE_UNSET+=LDAP\nOPTIONS_FILE_UNSET+=MANAGESIEVE\nOPTIONS_FILE_UNSET+=MYSQL\nOPTIONS_FILE_UNSET+=PGSQL\nOPTIONS_FILE_UNSET+=SQLITE\nOPTIONS_FILE_SET+=SSL\nOPTIONS_FILE_SET+=VPOPMAIL\n")
1386 0 0 unless $self->freebsd->is_port_installed('dovecot')
1389 0 0 unless (-e $config)
1390 0 0 if (-e '/usr/local/etc/dovecot-example.conf') { }
1406 0 0 unless ($Mail::Toaster::Setup::OSNAME eq 'freebsd')
1421 0 0 if (-x '/usr/local/etc/rc.d/dovecot')
1450 0 0 unless ($path and -d $path)
1456 0 0 if (-f $qpath)
1478 2 1 if defined $p{'test_ok'}
1480 1 0 unless ($self->conf->{'install_expat'})
1485 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'freebsd') { }
0 0 elsif ($Mail::Toaster::Setup::OSNAME eq 'darwin') { }
1486 0 0 if (-d '/usr/ports/textproc/expat') { }
1505 0 0 if defined $p{'test_ok'}
1507 0 0 if $Mail::Toaster::Setup::OSNAME ne 'freebsd'
1519 2 1 if defined $p{'test_ok'}
1524 1 0 unless ($ver)
1534 0 0 if ($ezmlm and -x $ezmlm)
1539 0 0 if $self->ezmlm_freebsd_port
1553 0 0 unless my $cgi = $self->toaster->get_toaster_cgibin
1557 0 0 if (-d $ezmlm_dist)
1558 0 0 if (not $self->util->source_warning('package', $ezmlm_dist, 'src', "$src/mail")) { }
1570 0 0 unless -e "$ezmlm_dist.tar.gz"
1573 0 0 unless -e "$idx.tar.gz"
1576 0 0 unless $self->util->extract_archive("$ezmlm_dist.tar.gz")
1579 0 0 unless $self->util->extract_archive("$idx.tar.gz")
1604 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'darwin') { }
0 0 elsif ($Mail::Toaster::Setup::OSNAME eq 'freebsd') { }
1608 0 0 unless (-d $local_include)
1640 0 0 if defined $p{'test_ok'}
1642 0 0 unless $self->conf->{'install_ezmlm_cgi'}
1644 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'freebsd')
1664 0 0 if $Mail::Toaster::Setup::OSNAME ne 'freebsd'
1665 0 0 if $self->conf->{'install_ezmlm'} ne 'port'
1666 0 0 if $self->freebsd->is_port_installed('ezmlm', 'fatal', 0)
1669 0 0 $self->conf->{'install_ezmlm_mysql'} ? :
1671 0 0 unless $self->freebsd->install_port('ezmlm-idx', 'options', "# This file was generated by mail-toaster\n# Options for ezmlm-idx-7.1.1_1\n_OPTIONS_READ=ezmlm-idx-7.1.1_1\n_FILE_COMPLETE_OPTIONS_LIST=DB DOCS MYSQL PGSQL SQLITE\nOPTIONS_FILE_$myopt+=DB\nOPTIONS_FILE_SET+=DOCS\nOPTIONS_FILE_$myopt+=MYSQL\nOPTIONS_FILE_UNSET+=PGSQL\nOPTIONS_FILE_UNSET+=SQLITE\n")
1687 0 0 unless copy('ezmlmglrc.sample', 'ezmlmglrc')
1690 0 0 unless copy('ezmlmrc.sample', 'ezmlmrc')
1693 0 0 unless copy('ezmlmsubrc.sample', 'ezmlmsubrc')
1703 2 0 if defined $p{'test_ok'}
1705 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'freebsd')
1722 0 0 if $self->conf->{'install_pyzor'}
1723 0 0 if $self->conf->{'install_bogofilter'}
1736 0 0 if $self->conf->{'install_dcc'}
1738 0 0 if $self->conf->{'install_procmail'}
1752 0 0 unless ($self->freebsd->is_port_installed('libiconv'))
1754 0 0 unless ($self->freebsd->is_port_installed('libiconv'))
1766 0 0 unless ($self->freebsd->is_port_installed('gettext'))
1768 0 0 unless ($self->freebsd->is_port_installed('gettext'))
1777 0 0 if (not $self->freebsd->is_port_installed('gmake'))
1779 0 0 if (not $self->freebsd->is_port_installed('gmake'))
1787 0 0 unless $self->conf->{'install_gnupg'}
1789 0 0 if ($self->conf->{'package_install_method'} eq 'packages')
1791 0 0 if $self->freebsd->is_port_installed('gnupg')
1811 0 0 unless $group
1812 0 0 if $self->group_exists($group)
1814 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'linux') { }
0 0 elsif ($Mail::Toaster::Setup::OSNAME eq 'freebsd') { }
0 0 elsif ($Mail::Toaster::Setup::OSNAME eq 'darwin') { }
1816 0 0 if $gid
1822 0 0 if $gid
1827 0 0 if ($cmd) { }
1829 0 0 if $gid
1835 0 0 if $gid
1849 0 0 unless my $group = lc shift()
1851 0 0 $gid && $gid > 0 ? :
1859 0 0 $ver ? :
1877 1 5 if ($curs[0] > $mins[0])
1878 1 4 if ($curs[1] > $mins[1])
1879 1 3 if ($curs[2] and $mins[2] and $curs[2] > $mins[2])
1880 0 0 if ($curs[3] and $mins[3] and $curs[3] > $mins[3])
1890 0 0 unless my $ver = $self->conf->{'install_isoqlog'}
1894 0 0 if ($ver eq 'port') { }
1895 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'freebsd') { }
1898 0 0 if $self->freebsd->is_port_installed('isoqlog', %p)
1906 0 0 if ($self->util->find_bin('isoqlog', 'fatal', 0))
1913 0 0 if $self->util->find_bin('isoqlog', 'fatal', 0)
1917 0 0 if $ver eq 'port' or $ver == 1
1921 0 0 if ($self->conf->{'toaster_prefix'})
1926 0 0 if ($self->conf->{'system_config_dir'})
1942 0 0 if ($self->conf->{'toaster_prefix'} ne '/usr/local')
1947 0 0 if ($self->util->find_bin('isoqlog', 'fatal', 0))
1963 0 0 if (-e $file)
1993 0 0 unless $self->util->file_write($file, 'lines', \@lines)
2000 0 0 if (not -e "$htdocs/isoqlog")
2011 2 1 if defined $p{'test_ok'}
2013 1 0 unless ($self->conf->{'install_lighttpd'})
2018 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'freebsd') { }
2022 0 0 unless $self->util->find_bin('lighttpd', 'fatal', 0)
2084 0 0 unless -e "/var/log/$_"
2094 0 0 if -d "$letc/lighttpd"
2098 0 0 if `grep toaster $letc/lighttpd.conf`
2176 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'freebsd') { }
0 0 elsif ($Mail::Toaster::Setup::OSNAME eq 'linux') { }
2192 0 0 if -d "$letc/lighttpd"
2310 0 0 if $verbose
2331 0 0 if defined $p{'test_ok'}
2340 0 0 unless defined $uid and defined $gid
2363 0 0 if (-w $logdir)
2364 0 0 unless chown $uid, $gid, $logdir
2369 0 0 unless (-d $logdir)
2370 0 0 unless mkdir $logdir, 493
2372 0 0 unless chown $uid, $gid, $logdir
2379 0 0 if (-d $dir) { }
2383 0 0 unless mkdir $dir, 493
2387 0 0 unless chown $uid, $gid, $dir
2406 0 0 if defined $p{'test_ok'}
2411 0 0 if $verbose
2424 2 1 if defined $p{'test_ok'}
2426 1 0 unless ($self->conf->{'install_munin'})
2433 0 0 if $Mail::Toaster::Setup::OSNAME ne 'freebsd'
2469 0 0 unless `grep qmailqstat "$munin_etc/plugin-conf.d/plugins.conf"`
2483 0 0 if (-d $dist)
2500 2 0 if defined $p{'test_ok'}
2528 0 0 unless -d "$http_base/$version"
2531 0 0 unless -l "$http_base/NicToolServer"
2546 0 0 unless -d "$http_base/$version"
2547 0 0 unless -l "$http_base/NicToolClient"
2567 0 0 unless -d $dir
2570 0 0 unless -e $key
2571 0 0 unless -e $key
2573 0 0 unless -e $csr
2574 0 0 unless -e $csr
2576 0 0 unless -e $crt
2577 0 0 unless -e $crt
2579 0 0 unless -e $pem
2580 0 0 unless -e $pem
2588 2 1 if defined $p{'test_ok'}
2590 0 1 unless ($self->conf->{'install_openssl'})
2596 1 0 if defined $self->conf->{'install_openssl_conf'} and not $self->conf->{'install_openssl_conf'}
2619 0 0 if $line =~ /^#/
2620 0 0 if $line =~ /req_distinguished_name/
2621 0 0 unless $inside
2622 0 0 if $line =~ /emailAddress_default/ and not $line =~ /example\.com/
2624 0 0 if $line =~ /^countryName_default/
2626 0 0 if $line =~ /^stateOrProvinceName_default/
2628 0 0 if $line =~ /^localityName\s+/
2630 0 0 if $line =~ /^0.organizationName_default/
2632 0 0 if $line =~ /^commonName_max/
2634 0 0 if $line =~ /^emailAddress_max/
2638 0 0 if ($discard)
2660 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'freebsd') { }
0 0 elsif ($Mail::Toaster::Setup::OSNAME eq 'darwin') { }
0 0 elsif ($Mail::Toaster::Setup::OSNAME eq 'linux') { }
2668 0 0 unless (-e $sslconf)
2674 0 0 unless -e $sslconf
2675 0 0 unless -w $sslconf
2683 0 0 unless my $conf = shift()
2685 0 0 if (not -e $conf and -e '/usr/local/openssl/openssl.cnf.sample')
2690 0 0 if (-d '/usr/local/openssl')
2691 0 0 if (not -e '/usr/local/openssl/openssl.cnf')
2702 0 0 $ciphers eq 'pci' ? :
0 0 $ciphers eq 'medium' ? :
0 0 $ciphers eq 'high' ? :
0 0 $ciphers eq 'all' ? :
2715 0 0 unless $self->conf->{'install_openssl'}
2717 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'freebsd') { }
2718 0 0 if (not $self->freebsd->is_port_installed('openssl'))
2724 0 0 if (not $bin) { }
2736 0 0 if ($self->freebsd->install_package('openssl'))
2764 0 0 if -e '/etc/periodic.conf'
2788 0 0 unless ($self->conf->{'install_squirrelmail'} or $self->conf->{'install_roundcube'})
2793 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'freebsd')
2805 0 0 unless $self->freebsd->install_port('php5', 'category', 'lang', 'options', "# This file generated by mail-toaster\n# Options for php5-5.4.16\n_OPTIONS_READ=php5-5.4.16\n_FILE_COMPLETE_OPTIONS_LIST=CLI CGI FPM APACHE AP2FILTER EMBED DEBUG DTRACE IPV6 MAILHEAD LINKTHR\nOPTIONS_FILE_SET+=CLI\nOPTIONS_FILE_SET+=CGI\nOPTIONS_FILE_UNSET+=FPM\nOPTIONS_FILE_UNSET+=APACHE\nOPTIONS_FILE_UNSET+=AP2FILTER\nOPTIONS_FILE_UNSET+=EMBED\nOPTIONS_FILE_UNSET+=DEBUG\nOPTIONS_FILE_UNSET+=DTRACE\nOPTIONS_FILE_SET+=IPV6\nOPTIONS_FILE_UNSET+=MAILHEAD\nOPTIONS_FILE_UNSET+=LINKTHR\n")
2826 0 0 unless (-e $config)
2827 0 0 if -e "$config-production"
2843 0 0 if -f $config
2851 0 0 if defined $p{'test_ok'}
2853 0 0 unless ($self->conf->{'install_phpmyadmin'})
2860 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'freebsd')
2872 0 0 unless ($self->conf->{'install_portmaster'})
2884 0 0 if $Mail::Toaster::Setup::OSNAME eq 'freebsd'
2885 0 0 if $Mail::Toaster::Setup::OSNAME eq 'darwin'
2895 2 1 if defined $p{'test_ok'}
2897 1 0 unless (my $ver = $self->conf->{'install_qmailadmin'})
2914 0 0 if $self->conf->{'qmailadmin_help_links'}
2916 0 0 if ($ver eq 'port')
2917 0 0 if ($Mail::Toaster::Setup::OSNAME ne 'freebsd')
2925 0 0 if $help
2931 0 0 if (-x "$cgi/qmailadmin")
2932 0 0 unless $self->util->yes_or_no('qmailadmin is installed, do you want to reinstall?', 'timeout', 60)
2939 0 0 if ($self->conf->{'qmailadmin_domain_autofill'})
2944 0 0 if ($self->util->yes_or_no("\nDo you want spam options? "))
2951 0 0 if ($self->conf->{'qmailadmin_modify_quotas'})
2956 0 0 if ($self->conf->{'qmailadmin_install_as_root'})
2963 0 0 if (defined $self->conf->{'qmailadmin_catchall'})
2964 0 0 unless $self->conf->{'qmailadmin_catchall'}
2967 0 0 if ($self->conf->{'qmailadmin_help_links'})
2972 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'darwin')
2989 0 0 if $help
2997 0 0 unless my $ver = $self->conf->{'qmailadmin_help_links'}
3001 0 0 if (-d $helpdir)
3013 0 0 unless (-e "$helpfile.tar.gz")
3019 0 0 unless (-e "$helpfile.tar.gz")
3026 0 0 unless move($helpfile, $helpdir)
3036 0 0 $conf->{'qmailadmin_help_links'} ? :
3037 0 0 $conf->{'qmailadmin_catchall'} ? :
3038 0 0 $conf->{'qmailadmin_modify_quotas'} ? :
3039 0 0 $conf->{'qmailadmin_domain_autofill'} ? :
3040 0 0 $conf->{'qmailadmin_spam_option'} ? :
3045 0 0 if $conf->{'qmail_dir'} ne '/var/qmail'
3047 0 0 if ($spam eq 'SET' and $conf->{'qmailadmin_spam_command'})
3072 0 0 if ($conf->{'qmailadmin_install_as_root'})
3131 1 2 unless (my $ver = $self->conf->{'install_razor'})
3136 2 0 if defined $p{'test_ok'}
3141 0 0 if ($ver eq 'port')
3142 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'freebsd') { }
0 0 elsif ($Mail::Toaster::Setup::OSNAME eq 'darwin') { }
3153 0 0 if ($self->util->find_bin('razor-client', 'fatal', 0))
3159 0 0 if $ver == 1 or $ver eq 'port'
3176 0 0 if (-d '/etc/razor')
3185 0 0 if (-x $client and not -x $admin)
3189 0 0 unless (-x $admin)
3198 0 0 if (-e $file)
3201 0 0 if ($line =~ /^logfile/)
3209 0 0 if (-e $file)
3210 0 0 unless (`grep razor-agent $file`)
3226 0 0 unless (-f $file_path)
3231 0 0 if $self->{'verbose'}
3241 0 0 if $self->{'verbose'}
3249 0 0 if defined $p{'test_ok'}
3252 0 0 unless ($ver)
3259 0 0 if ($ver eq 'port' or $ver eq '1')
3261 0 0 if ($self->util->find_bin('ripmime', 'fatal', 0))
3266 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'freebsd') { }
0 0 elsif ($Mail::Toaster::Setup::OSNAME eq 'darwin') { }
3267 0 0 if $self->freebsd->install_port('ripmime')
3270 0 0 if $self->darwin->install_port('ripmime')
3273 0 0 if ($self->util->find_bin('ripmime', 'fatal', 0))
3282 0 0 if (-x $ripmime)
3286 0 0 if ($ver eq $installed)
3306 0 0 if defined $p{'test_ok'}
3308 0 0 unless ($self->conf->{'install_rrdutil'})
3313 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'freebsd') { }
0 0 elsif ($Mail::Toaster::Setup::OSNAME eq 'darwin') { }
3330 0 0 if -x $self->util->find_bin('rrdtool', 'fatal', 0)
3347 2 1 if defined $p{'test_ok'}
3349 1 0 unless ($self->conf->{'install_roundcube'})
3354 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'freebsd') { }
3355 0 0 unless $self->php
3356 0 0 unless $self->roundcube_freebsd
3372 0 0 unless $self->freebsd->install_port('roundcube', 'category', 'mail', 'options', "# Options for roundcube-0.9.2,1\n_OPTIONS_READ=roundcube-0.9.2,1\n_FILE_COMPLETE_OPTIONS_LIST=GD LDAP NSC PSPELL SSL MYSQL PGSQL SQLITE\nOPTIONS_FILE_UNSET+=GD\nOPTIONS_FILE_UNSET+=LDAP\nOPTIONS_FILE_UNSET+=NSC\nOPTIONS_FILE_UNSET+=PSPELL\nOPTIONS_FILE_SET+=SSL\nOPTIONS_FILE_UNSET+=MYSQL\nOPTIONS_FILE_UNSET+=PGSQL\nOPTIONS_FILE_SET+=SQLITE\n")
3397 0 0 unless -e "$config/$c"
3400 0 0 unless (-f "$config/db.inc.php")
3449 0 0 if defined $p{'test_ok'}
3451 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'freebsd') { }
0 0 elsif ($Mail::Toaster::Setup::OSNAME eq 'darwin') { }
3483 0 0 unless $newconf
3506 0 0 unless (-d $logdir)
3508 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'freebsd') { }
3518 0 0 unless (-d $logdir)
3519 0 0 unless mkdir $logdir, 493
3520 0 0 unless chown $uid, $gid, $logdir
3524 0 0 unless (-d "$logdir/$prot")
3525 0 0 unless mkdir "$logdir/$prot", 493
3528 0 0 unless chown $uid, $gid, "$logdir/$prot"
3544 0 0 if (-s $run_f)
3571 2 1 if defined $p{'test_ok'}
3573 1 0 unless ($self->conf->{'install_spamassassin'})
3578 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'freebsd') { }
0 0 elsif ($Mail::Toaster::Setup::OSNAME eq 'darwin') { }
3583 0 0 if $self->conf->{'install_procmail'}
3587 0 0 if $self->conf->{'install_bogofilter'}
3606 0 0 if ($self->conf->{'install_spamassassin_sql'})
3639 0 0 -f '/usr/local/etc/rc.d/spamd' ? :
0 0 -f '/usr/local/etc/rc.d/spamd.sh' ? :
3660 0 0 unless ($self->util->is_process_running('spamd'))
3661 0 0 if (-x $start) { }
3678 0 0 if defined $p{'test_ok'}
3680 0 0 unless ($self->conf->{'install_mysql'} and $self->conf->{'install_spamassassin_sql'})
3685 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'freebsd') { }
3738 0 0 unless ($self->freebsd->is_port_installed('spamassassin'))
3744 0 0 if (-f '/usr/local/etc/mail/spamassassin/sql.cf')
3757 0 0 if ($dbh)
3760 0 0 if ($sth->errstr) { }
3778 0 0 unless (-x $mysqlbin)
3783 0 0 unless (-f "$sqldir/$f")
3787 0 0 if (`grep MyISAM "$sqldir/$f"`)
3790 0 0 if ($line eq ') TYPE=MyISAM;')
3800 0 0 unless (-f $file)
3828 0 0 unless my $update = $self->util->find_bin('sa-update', 'fatal', 0)
3829 0 0 if (system $update)
3834 0 0 if system "$update --nogpg"
3879 2 1 if defined $p{'test_ok'}
3881 1 0 unless (my $ver = $self->conf->{'install_squirrelmail'})
3886 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'freebsd' and $ver eq 'port')
3888 0 0 if $self->squirrelmail_freebsd
3891 0 0 if $ver eq 'port'
3899 0 0 unless (-d $htdocs)
3900 0 0 if -d '/var/www/data'
3901 0 0 if -d '/Library/Webserver/Documents'
3905 0 0 if (-d "$htdocs/squirrelmail")
3926 0 0 if $self->conf->{'install_squirrelmail_sql'}
3933 0 0 unless $self->freebsd->is_port_installed('squirrelmail')
3935 0 0 unless -d $sqdir
3946 0 0 unless $self->conf->{'install_mysql'}
3947 0 0 unless $self->conf->{'install_squirrelmail_sql'}
3949 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'freebsd')
3967 0 0 if ($dbh)
3971 0 0 unless ($sth->errstr)
4053 0 0 if -e "$sqdir/config/config.php"
4063 0 0 if ($self->conf->{'install_squirrelmail_sql'})
4084 0 0 if (-d "$sqdir/plugins/sasql")
4085 0 0 unless (-e "$sqdir/plugins/sasql/sasql_conf.php")
4106 2 1 if defined $p{'test_ok'}
4108 1 0 unless (my $ver = $self->conf->{'install_sqwebmail'})
4117 0 0 unless ($cgi and -d $cgi)
4120 0 0 unless (-d $datadir)
4121 0 0 if (-d "$httpdir/data/mail") { }
0 0 elsif (-d "$httpdir/mail") { }
4126 0 0 -e "$prefix/etc/apache24/mime.types" ? :
0 0 -e "$prefix/etc/apache22/mime.types" ? :
0 0 -e "$prefix/etc/apache2/mime.types" ? :
4133 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'freebsd' and $ver eq 'port')
4137 0 0 if $ver eq 'port'
4139 0 0 if (-x "$prefix/libexec/sqwebmail/sqwebmaild")
4140 0 0 unless ($self->util->yes_or_no('Sqwebmail is already installed, re-install it?', 'timeout', 300))
4157 0 0 if (-d "$package")
4158 0 0 unless ($self->util->source_warning($package, 1, $src))
4164 0 0 unless (-e "$package.tar.bz2")
4166 0 0 unless (-e "$package.tar.bz2")
4173 0 0 unless chdir $package
4181 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'darwin')
4192 0 0 if (-d $share) { }
4206 0 0 unless copy("$share/ldapaddressbook.dist", "$share/ldapaddressbook")
4221 0 0 unless (-e $cachedir)
4229 0 0 unless -w $file
4233 0 0 if ($line =~ /^[#]{0,1}PIDFILE/)
4250 0 0 if ($cgi =~ m[/usr/local/(.*)$])
4251 0 0 if ($datadir =~ m[/usr/local/(.*)$])
4292 0 0 -x "$start.sh" ? :
0 0 -x $start ? :
4302 0 0 if $Mail::Toaster::Setup::OSNAME eq 'freebsd'
4306 0 0 unless -x $stunnel
4330 0 0 if defined $p{'test_ok'}
4351 0 0 if (system("$svok $svc_dir/send") == 0)
4376 0 0 unless $self->toaster->service_dir_test
4378 0 0 if defined $p{'test_ok'}
4380 0 0 if $Mail::Toaster::Setup::OSNAME eq 'freebsd'
4381 0 0 if $Mail::Toaster::Setup::OSNAME eq 'darwin'
4393 0 0 unless (-e $start)
4395 0 0 unless my $r = $self->util->install_if_changed('newfile', 'to.yp.cr.daemontools-svscan.plist', 'existing', $start, 'mode', '0551', 'clean', 1)
4401 0 0 $r == 1 ? :
4408 0 0 if (-w $start)
4411 0 0 unless my $r = $self->util->install_if_changed('newfile', 'services-darwin.txt', 'existing', $start, 'mode', '0551', 'clean', 1)
4418 0 0 $r == 1 ? :
4431 0 0 unless (-f $start)
4438 0 0 unless my $r = $self->util->install_if_changed('newfile', 'services.txt', 'existing', $start, 'mode', '0751', 'clean', 1)
4445 0 0 $r == 1 ? :
4456 0 0 if -e "$confdir/rc.d/qmail"
4457 0 0 if -e "$confdir/rc.d/qmail.sh"
4461 0 0 if -l $sym and -x $sym
4463 0 0 if -e $sym
4477 0 0 if (-s "$etc_dir/tcp.smtp")
4479 0 0 if ($count > 1)
4523 0 0 unless $self->util->syscmd("$tcprules $dir/tcp.smtp.cdb $dir/tcp.smtp.tmp < $dir/tcp.smtp")
4546 0 0 if ($self->conf->{'install_mysql'} and $self->conf->{'vpopmail_mysql'})
4550 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'freebsd') { }
0 0 elsif ($Mail::Toaster::Setup::OSNAME eq 'darwin') { }
0 0 elsif ($Mail::Toaster::Setup::OSNAME eq 'linux') { }
4571 0 0 if ($tcpserver)
4572 0 0 unless ($self->conf->{'install_mysql'} and $self->conf->{'vpopmail_mysql'})
4577 0 0 if (grep {/sql/;} `$strings $tcpserver`)
4586 0 0 if (-e '/usr/ports/distfiles/ucspi-tcp-0.88.tar.gz')
4601 0 0 $self->util->find_bin('tcpserver', 'fatal', 0, 'verbose', 0) ? :
4609 0 0 if ($self->conf->{'vpopmail_mysql'})
4611 0 0 unless (-d "$mysql_prefix/include/mysql")
4612 0 0 if (-d '/usr/include/mysql')
4650 0 0 if ($self->conf->{'install_mysql'} and $self->conf->{'vpopmail_mysql'})
4663 0 0 unless $user
4664 0 0 if $self->user_exists($user)
4670 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'linux') { }
0 0 elsif ($Mail::Toaster::Setup::OSNAME eq 'freebsd') { }
0 0 elsif ($Mail::Toaster::Setup::OSNAME eq 'darwin') { }
4673 0 0 if $homedir
4674 0 0 if $uid
4675 0 0 if $gid
4681 0 0 if $homedir
4682 0 0 if $uid
4683 0 0 if $gid
4689 0 0 if ($cmd) { }
4694 0 0 if $homedir
4702 0 0 if $homedir
4717 0 0 unless my $user = lc shift()
4719 0 0 $uid && $uid > 0 ? :
4731 2 1 if defined $p{'test_ok'}
4733 1 0 unless ($self->conf->{'install_vqadmin'})
4741 0 0 if ($cgi and $cgi =~ m[/usr/local/(.*)$])
4743 0 0 if $cgi =~ m[/$]
4746 0 0 if ($data =~ m[/usr/local/(.*)$])
4747 0 0 if $data =~ m[/$]
4754 0 0 if defined $p{'test_ok'}
4756 0 0 if ($Mail::Toaster::Setup::OSNAME eq 'freebsd')
4757 0 0 if $self->freebsd->install_port('vqadmin', 'flags', join(',', @defs))
4782 0 0 unless (-d $dir)
4783 0 0 if (-d "/usr/local/src/Mail-Toaster-$tver/cgi_files")
4788 0 0 unless -d $dir
4801 0 0 if ($line =~ /\Avar mailhost /)
4808 0 0 unless my $rsync = $self->rsync
4814 0 0 unless $self->util->yes_or_no("\n\n\t CAUTION! DANGER! CAUTION!\n\n This action will install the Mail::Toaster webmail interface. Doing\n so may overwrite existing files in $htdocs. Is is safe to proceed?\n\n", 'timeout', 60)