NAME
Mail::Toaster::Setup
DESCRIPTION
The meat and potatoes of toaster_setup.pl. This is where the majority of the work gets done. Big chunks of the code got moved here, mainly because toaster_setup.pl was getting rather unwieldly. The biggest benefit requiring me to clean up the code considerably. It's now in nice tidy little subroutines that are pretty easy to read and understand.
InstallPhpMyAdminW
use Mail::Toaster::Setup;
InstallPhpMyAdminW($conf);
Installs PhpMyAdmin for you, based on your settings in toaster-watcher.conf. The actual code that does the work is in MATT::Mysql (part of MATT::Bundle) so read the man page for MATT::Mysql for more info.
InstallVqadmin
use Mail::Toaster::Setup;
InstallVqadmin($conf);
Installs vqadmin from FreeBSD ports. It honors your cgi-bin and your htdocs directory as configured in toaster-watcher.conf.
InstallMysqld
use Mail::Toaster::Setup;
InstallMysqld($conf);
Installs mysql server for you, based on your settings in toaster-watcher.conf. The actual code that does the work is in MATT::Mysql (part of MATT::Bundle) so read the man page for MATT::Mysql for more info.
InstallSources
use Mail::Toaster::Setup;
InstallSources($conf, $toaster);
Update your FreeBSD source tree (/usr/src). Uses cvsup_fastest to pick the fastest server in your country (configure in toaster-watcher.conf) and then updates from there. Updates based on any cvsup settings in /etc/cvsup-stable). Configure that file to suit your preferences. If that file doesn't exist, it will be created for you.
ApacheConfPatch
# moved to MATT::Apache
# delete this sub at some point
use MATT::Apache;
ApacheConfPatch;
InstallMATTBundle
use Mail::Toaster::Setup;
InstallMATTBundle;
Downloads and installs the latest version of MATT::Bundle.
InstallRRDutil
use Mail::Toaster::Setup;
InstallRRDutil;
Checks for and installs any missing programs upon which RRDutil depends (rrdtool, net-snmp, Net::SNMP, Time::Date) and then downloads and installs the latest version of RRDutil.
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.
InstallPorts
use Mail::Toaster::Setup;
InstallPorts($conf, $toaster);
Install the FreeBSD ports tree and update it with cvsup. Optionally uses cvsup_fastest to choose the fastest cvsup server to mirror from. Configure toaster-watch.conf to adjust it's behaviour.
Installs 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 toastser related ports such as qmail since we have customized version(s) of them installed.
InstallApache
use Mail::Toaster::Setup;
InstallApache($conf, $version);
Calls MATT::Apache::InstallApache[1|2] which then builds and install Apache for you based on how it was called. See MATT::Apache:InstallApache (part of MATT::Bundle) for more details.
InstallVpopmail
use Mail::Toaster::Setup;
InstallVpopmail($conf);
Vpopmail is great, but it has lots of options and remembering which option you used months or years ago to build a mail server isn't always easy. So, store all the settings in toaster-watcher.conf and this sub will install vpopmail for you honoring all your settings and passing the appropriate configure flags to vpopmail's configure.
If you don't have toaster-watcher.conf installed, it'll ask you a series of questions and then install based on your answers.
is_newer
Checks a three place version string like 5.3.24 to see if the current version is newer than some value. Useful when you have various version of a program like vpopmail or mysql and the syntax you need to use for building it is different for differing version of the software.
SetupVmysql
use Mail::Toaster::Setup;
SetupVmysql(replication, master, slave, user, pass);
Version 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.
InstallSquirrelmail
Use Mail::Toaster::Setup;
InstallSquirrelmail
Installs Squirrelmail using FreeBSD ports. Adjusts the FreeBSD port by passing along WITH_APACHE2 if you have Apache2 selected installed in your toaster-watcher.conf.
InstallMailLogs
use Mail::Toaster::Setup;
InstallMailLogs($conf);
Installs the maillogs script, creates the logging directories (/var/log/mail/*), creates the qmail supervise dirs, installs maillogs as a log post-process and then builds the corresponding service/log/run file to use the post-processor.
InstallSockLog
use Mail::Toaster::Setup;
InstallSockLog($conf, $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.
InstallSocklogQmailControl
use Mail::Toaster::Setup;
InstallSocklogQmailControl($service, $ip, $user, $supervisedir);
Builds a service/log/run file for use with socklog.
InstallFilter
use Mail::Toaster::Setup;
InstallFilter($conf);
Installs SpamAssassin, ClamAV, QmailScanner, maildrop, procmail, and programs that support the aforementioned ones. See toaster-watcher.conf for options that allow you to customize the programs that are installed.
InstallMaildropFiles
use Mail::Toaster::Setup;
InstallMaildropFiles($toaster_site_url);
Installs a maildrop filter in /usr/local/etc/mail/mailfilter, a script for use with Courier-IMAP in /usr/local/sbin/subscribeIMAP.sh, and sets up a filter debugging file in /var/log/mail/maildrop.log.
ConfigSpamAssassin
use Mail::Toaster::Setup;
ConfigSpamAssassin();
Shows this URL: http://www.yrex.com/spam/spamconfig.php
ConfigQmailScanner
use Mail::Toaster::Setup;
ConfigQmailScanner;
prints out a note telling you how to enable qmail-scanner.
InstallQmailScanner
use Mail::Toaster::Setup;
InstallQmailScanner($conf, $src);
InstallClamAV
use Mail::Toaster::Setup;
InstallClamAV($conf);
InstallToasterDependencies
use Mail::Toaster::Setup;
InstallToasterDependencies($conf);
Installs a bunch of programs that are needed by subsequent programs we'll be installing. You can install these yourself if you'd like, this doesn't do anything special beyond installing them:
ispell, gdbm, setquota, autoconf, automake, expect, gnupg, maildrop, mysql-client(3), autorespond, qmail, qmailanalog, daemontools, openldap-client, Compress::Zlib, Crypt::PasswdMD5, HTML::Template, Net::DNS, Crypt::OpenSSL-RSA, DBI, DBD::mysql, TimeDate.
InstallCourier
use Mail::Toaster::Setup;
InstallCourier($conf, $package);
Installs courier imap based on your settings in toaster-watcher.conf.
SourceWarning
use Mail::Toaster::Setup;
SourceWarning($package, $clean, $src);
InstallSqwebmail
use Mail::Toaster::Setup;
InstallSqwebmail($conf, $package);
InstallSqwebmail based on your settings in toaster-watcher.conf.
InstallQmailadmin
use Mail::Toaster::Setup;
InstallQmailadmin($conf);
Install qmailadmin based on your settings in toaster-watcher.conf.
InstallUCSPI
use Mail::Toaster::Setup;
InstallUCSPI($conf);
Installs ucspi-tcp with my (Matt Simerson) MySQL patch.
InstallEzmlm
use Mail::Toaster::Setup;
InstallEzmlm($conf);
Installs Ezmlm-idx. This also tweaks the port Makefile so that it'll build against MySQL 4.0 libraries as if you don't have MySQL 3 installed. It also copies the sample config files into place so that you have some default settings.
ConfigCourier
use Mail::Toaster::Setup;
ConfigCourier($confdir);
Does all the post-install configuration of Courier IMAP.
ConfigVpopmailEtc
use Mail::Toaster::Setup;
ConfigVpopmailEtc($conf);
Builds the ~vpopmail/etc/tcp.smtp file.
InstallSupervise
use Mail::Toaster::Setup;
InstallSupervise($conf);
One stop shopping: calls the following subs:
ConfigureQmailControl($conf);
CreateServiceDir($conf);
CreateSuperviseDirs($supervise);
InstallQmailSuperviseRunFiles($conf, $supervise );
InstallQmailSuperviseLogRunFiles($conf);
ConfigureServices($conf, $supervise);
CreateServiceDir
Create the supevised services directory (if it doesn't exist).
use Mail::Toaster::Setup;
InstallSupervise($conf);
Also sets the permissions of 775.
ConfigureServices
Sets up the supervised mail services for Mail::Toaster
use Mail::Toaster::Setup;
ConfigureServices($conf, $supervise);
This creates (if it doesn't exist) /var/service and populates it with symlinks to the supervise control directories (typicall /var/qmail/supervise). Creates and sets permissions on the following directories and files:
/var/service
/var/service/pop3
/var/service/smtp
/var/service/send
/var/service/submit
/usr/local/etc/rc.d/services.sh
/usr/local/sbin/services
CreateSuperviseDirs
Creates the qmail supervise directories.
use Mail::Toaster::Setup;
CreateSuperviseDirs($supervise);
The directories created are:
$supervise/smtp
$supervise/submit
$supervise/send
$supervise/pop3
InstallQmail
Builds qmail and installs qmail with patches (based on your settings in toaster-watcher.conf), installs the SSL certs, adjusts the permissions of several files that need it.
use Mail::Toaster::Setup;
InstallQmail($conf, $package);
$conf is a hash of values from toaster-watcher.conf used to determine how to configured your qmail.
$package is the name of the program. It defaults to "qmail-1.03"
Patch info is here: http://www.tnpi.biz/internet/mail/toaster/patches/
AUTHOR
Matt Simerson - matt@tnpi.biz
BUGS
None known. Report any to matt@cadillac.net.
TODO
Documentation. Needs more documenation.
SEE ALSO
http://matt.simerson.net/computing/mail/toaster/
Mail::Toaster::CGI, Mail::Toaster::DNS, Mail::Toaster::Logs, Mail::Toaster::Qmail, Mail::Toaster::Setup
COPYRIGHT
Copyright 2001 - 2003, The Network People, Inc. All Right Reserved.