Step 1: Make Perl happy.

Certain features (like spam filtering) require perl 5.6.1 or higher to function fully. If perl -v reflects anything smaller than 5.6.1, you need to update it.

  cd /usr/ports/lang/perl5.8;
  make -DENABLE_SUIDPERL install clean;
  rehash; use.perl port;

You need Perl's CPAN working for installing perl modules so make sure it's configured. If the following command doesn't give you a prompt, then you'll be prompted to configure.

  perl -MCPAN -e shell
  exit

In Perl 5.8+, suid perl is not enabled by default. Qmail-Scanner requires suid perl and will not work (or install) without it. Enable suidperl by adding -DENABLE_SUIDPERL to your make command (as shown above), or if using pkg* and friends, add the following line to the MAKE_ARGS of /usr/local/etc/pkgtools.conf:

 'lang/perl5.8' => 'ENABLE_SUIDPERL=yes',

I have build a suid perl 5.8.2 package to speed up the install. I install it this way:

  pkg_add -r http://www.tnpi.biz/internet/mail/toaster/src/perl-5.8.2_5.tbz


Step 2: Install Mail::Toaster

http://www.tnpi.biz/internet/mail/toaster/Mail-Toaster.tar.gz

   perl Makefile.PL
   make install
   make newconf (overwrites installed .conf files)
   make cgi

Documentation for the modules being called by toaster_setup.pl, toaster_watcher.pl, maillogs, and index.cgi are all installed in Perl's pod format (perldoc Mail::Toaster) as well as being available online at http://www.tnpi.biz/internet/mail/toaster/.

You will likely get prompted to install a few missing perl modules such as DBI and DBD::mysql. When prompted, choose no. The modules will get installed later.


Step 3: Edit config files

   vi /usr/local/etc/toaster.conf
   vi /usr/local/etc/toaster-watcher.conf

Edit to suit your preferences. Use 'perldoc toaster.conf' or 'perldoc toaster-watcher.conf' to read the man pages describing what all them settings are for.


Step 4: Start building the toaster!

   rehash
   toaster_setup.pl -s pre
   toaster_setup.pl -s ports
   toaster_setup.pl -s mattbundle
   toaster_setup.pl -s mysql
   toaster_setup.pl -s [ apache2 | apache ]
   toaster_setup.pl -s phpmyadmin (optional)
   toaster_setup.pl -s ucspi
   toaster_setup.pl -s ezmlm 
   toaster_setup.pl -s vpopmail
   toaster_setup.pl -s qmailadmin

NOTICE: The default install method is now ports (instead of packages). You can alter this in toaster-watcher.conf. This default was changed due to incompatibility problems with the precompiled packages on FreeBSD's servers (notable MySQL and SNMPd). The flip side is that it's typical that at least one of the thousands of FreeBSD ports is broken. When you find a port that won't compile, try installing the package (ie. ``pkg_add -r expat'' ) instead. In most cases, this will resolve the issue for you. I install MySQL & snmpd from ports, set the install method to packages, and it works great every time.

If toaster_setup.pl has any problems running, fix what it complains about and then run it again with the same parameter. It will resume and finish that section.

If you want something installed ``your'' way, install it first. Toaster_setup.pl will detect it (assuming it's registered in the package database) and skip that portion of the install.

When you install Apache, it'll also install PHP which is required by squirrelmail and QSS. Make sure to select the following modules: GD, MYSQL, & OPENSSL. Other modules are optional, I recommend selecting those I've listed in addition to the ``defaults''. The more options you select, the more likely you are to have problems.


Step 5: Install Qmail

   toaster_setup.pl -s qmail

patch info: http://www.tnpi.biz/internet/mail/toaster/patches/


Step 6: Install Web/POP3/IMAP servers

   toaster_setup.pl -s courier
   toaster_setup.pl -s sqwebmail
   toaster_setup.pl -s squirrelmail


Step 7: Configure Courier-IMAP

   cd /usr/local/etc/courier-imap
   vi pop3d.cnf imapd.cnf quotawarnmsg
   cd /usr/local/share/courier-imap
   ./mkimapdcert; ./mkpop3dcert


Step 8: Set up mail filtering and logging

   toaster_setup.pl -s filter

You can safely skip this step. However, all the spiffy anti-virus and spam detection software will not work. If this is your first mail toaster, you may even want to skip this step, get everything working to your satisfaction and then add in the mail filtering. It can be daunting for the faint of heart.

   toaster_setup.pl -s maillogs
   toaster_setup.pl -s supervise
   toaster_setup.pl -s rrdutil (optional)


Step 9: Add cron entries

Run all these commands from the command line and verify their proper functionality (no complaints or errors) BEFORE adding to cron.

 crontab -u root -e 
 9-59/10 * * * * /usr/local/vpopmail/bin/clearopensmtp
 40  * * * *  /usr/local/share/sqwebmail/cleancache.pl
 */5 * * * * /usr/local/sbin/toaster-watcher.pl
 */5 * * * * /usr/local/www/cgi-bin/rrdutil.cgi -a update
 01 01 * * * /var/qmail/bin/update_tmprsadh > /dev/null 2>&1


Step 10: Continue with Configuration.

Visit this URL: http://www.tnpi.biz/internet/mail/toaster/config.shtml Skipping this step is guaranteed to make you less than pleased with your toaster.

See http://mail.cadillac.net/ for an example of index.cgi.