Mail::Toaster::Setup
The meat and potatoes of toaster_setup.pl. This is where the majority of the work gets done. Big chunks of the code and logic for getting all the various applications and scripts installed and configured resides in here.
All documented methods in this package (shown below) accept two optional arguments, debug and fatal. Setting debug to zero will supress nearly all informational and debugging output. If you want more output, simply pass along debug=>1 and status messages will print out. Fatal allows you to override the default behaviour of these methods, which is to die upon error. Each sub returns 0 if the action failed and 1 for success.
arguments required: varies (most require conf) arguments optional: debug - print status messages fatal - die on errors (default)
result: 0 - failure 1 - success
Examples:
1. $setup->apache( debug=>0, fatal=>0 ); Try to build apache, do not print status messages and do not die on error(s).
2. $setup->apache( debug=>1 ); Try to build apache, print status messages, die on error(s).
3. if ( $setup->apache( ) { print "yay!\n" }; Test to see if apache installed correctly.
use Mail::Toaster::Setup; my $setup = Mail::Toaster::Setup->new;
From there you can run any of the following methods via $setup->method as documented below.
Many of the methods require $conf, which is a hashref containing the contents of toaster-watcher.conf.
$setup->apache( ver=>22 );
There are many popular Apache compile time options supported. To see what options are available, see toaster-watcher.conf.
required arguments: conf
optional arguments: ver - the version number of Apache to install debug fatal
$setup->autorespond( );
required arguments: conf
optional arguments: debug fatal
$setup->clamav( );
required arguments: conf
optional arguments: debug fatal
required arguments: conf
optional arguments: debug fatal
$setup->courier( );
Installs courier imap based on your settings in toaster-watcher.conf.
required arguments: conf
optional arguments: debug fatal
result: 1 - success 0 - failure
$setup->courier_startup( );
Does the post-install configuration of Courier IMAP.
$setup->cpan( );
Installs only the perl modules that are required for 'make test' to succeed. Useful for CPAN testers.
Date::Parse HTML::Template Compress::Zlib Crypt::PasswdMD5 Net::DNS Quota TimeDate
required arguments: conf
optional arguments: debug fatal
result: 1 - success 0 - failure
Usage: $setup->daemontools( conf->$conf );
required arguments: conf
optional arguments: debug fatal
result: 1 - success 0 - failure
$setup->dependencies( );
Installs a bunch of dependency programs that are needed by other programs we will install later during the build of a Mail::Toaster. You can install these yourself if you would like, this does not do anything special beyond installing them:
ispell, gdbm, setquota, expect, maildrop, autorespond, qmail, qmailanalog, daemontools, openldap-client, Crypt::OpenSSL-RSA, DBI, DBD::mysql.
required arguments: conf
optional arguments: debug fatal
result: 1 - success 0 - failure
$setup->djbdns( );
required arguments: conf
optional arguments: debug fatal
result: 1 - success 0 - failure
$setup->ezmlm( );
required arguments: conf
optional arguments: debug fatal
result: 1 - success 0 - failure
$setup->filtering();
$setup->isoqlog();
$setup->maildrop( );
$setup->maildrop_filter();
$setup->maillogs();
$setup->mattbundle(debug=>1);
Don't do it. Matt::Bundle has been deprecated for years now.
$setup->mysql( );
$setup->phpmyadmin($conf);
On FreeBSD, it optionally uses cvsup_fastest to choose the fastest cvsup server to mirror from. Configure toaster-watch.conf to adjust it's behaviour. It can also install the portupgrade port to use for updating your legacy installed ports. Portupgrade is very useful, but be very careful about using portupgrade -a. I always use portupgrade -ai and skip the toaster related ports such as qmail since we have customized version(s)
of them installed.
$setup->ports();
$setup->qmailadmin();
$setup->qmail_scanner();
$setup->qmail_scanner_config;
$setup->qmail_scanner_test();
$setup->qs_stats();
$setup->razor( );
$setup->ripmime();
If upgrading, it is wise to check for differences in your installed rrdutil.conf and the latest rrdutil.conf-dist included in the RRDutil distribution.
$setup->rrdutil;
$setup->simscan();
See toaster-watcher.conf to see how these settings affect the build and operations of simscan.
$setup->simscan_test();
$setup->socklog( ip=>$ip );
If you need to use socklog, then you'll appreciate how nicely this configures it. :) $ip is the IP address of the socklog master server.
socklog_qmail_control($service, $ip, $user, $supervisedir);
Builds a service/log/run file for use with socklog.
$setup->config_spamassassin();
Shows this URL: http://www.yrex.com/spam/spamconfig.php
$setup->squirrelmail
Installs Squirrelmail using FreeBSD ports. Adjusts the FreeBSD port by passing along WITH_APACHE2 if you have Apache2 selected in your toaster-watcher.conf.
$setup->sqwebmail();
install sqwebmail based on your settings in toaster-watcher.conf.
$setup->supervise();
One stop shopping: calls the following subs:
$qmail->control_create (conf=>$conf); $setup->service_dir_create (); $toaster->supervise_dirs_create (conf=>$conf); $qmail->install_qmail_control_files ( conf=>$conf ); $qmail->install_qmail_control_log_files( conf=>$conf); $setup->service_symlinks ( debug=>$debug);
$setup->service_symlinks();
This populates the supervised service directory (default: /var/service) with symlinks to the supervise control directories (typically /var/qmail/supervise/). Creates and sets permissions on the following directories and files:
/var/service/pop3 /var/service/smtp /var/service/send /var/service/submit
$setup->startup_script( );
If they don't already exist, this sub will create:
daemontools service directory (default /var/service) symlink to the services script
The services script allows you to run ``services stop'' or ``services start'' on your system to control the supervised daemons (qmail-smtpd, qmail-pop3, qmail-send, qmail-submit). It affects the following files:
$prefix/etc/rc.d/[svscan|services].sh /usr/local/sbin/services
$setup->ucspi_tcp( );
$setup->vpopmail( );
If you do not have toaster-watcher.conf installed, it will ask you a series of questions and then install based on your answers.
$setup->vpopmail_etc( );
vpopmail_vmysql_h(replication, master, slave, user, pass);
Versions of vpopmail less than 5.2.26 (or thereabouts) required you to manually edit vmysql.h to set your mysql login parameters. This sub modifies that file for you.
$setup->vpopmail_mysql_privs($conf);
$setup->vqadmin($conf, $debug);
Installs vqadmin from ports on FreeBSD and from sources on other platforms. It honors your cgi-bin and your htdocs directory as configured in toaster-watcher.conf.
IO::Socket::SSL
Matt Simerson - matt@tnpi.net
None known. Report to author. Patches welcome (diff -u preferred)
Better documentation. It is almost reasonable now.
The following are all man/perldoc pages:
Mail::Toaster Mail::Toaster::Conf toaster.conf toaster-watcher.conf
http://mail-toaster.org/
Copyright (c) 2004-2006, The Network People, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of the The Network People, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.