Installing
FreeBSD
Install
a standard installation with ports from the boot cd menu.
-
Install
Perl
-
Install
from FreeBSD ports:
cd /usr/ports/lang/perl5.8;
make -D
ENABLE_SUIDPERL=yes install clean;
-
Install
mail-toaster
-
Create the source directory to build everything in.
mkdir -p /usr/local/src
cd /usr/local/src
fetch http://mail-toaster.org/Mail-Toaster.tar.gz
-
Once
downloaded, extract the archive and install it much like you would
any other perl module.
tar -xzf Mail-Toaster.tar.gz
cd
Mail-Toaster-*
perl Makefile.PL
make deps **
make
test
make install
-
Installing
Ports
-
bin/toaster_setup.pl -s ports
-
portsdb -Fu(y/n) Say no to this by pressing n and <ENTER>
-
The next step requires openssl support so install it as follows:
pkg_add -r openssl
cp /usr/local/openssl/openssl.cnf.sample /usr/local/openssl/openssl.cnf
ln -s /usr/local/lib/libcrypto.so.5 /usr/local/lib/libcrypto.so.4
OR (at the time of this writing, the openssl-stable port is broken)
cd /usr/ports/security/openssl-stable
make && make install
-
Also, apache doesn't build in one of the script down the line so lets get apache out of the way.
cd /usr/ports/www/apache22
make && make install clean
-
apache22 menu: choose defaults
-
Installing/Editing Config Files
-
If you're
only interested in making the required changes, you can use the
"quick start" method:
cd
/usr/local/src/Mail-Toaster-*
bin/toaster_setup.pl -s
config
bin/toaster_setup.pl -s ssl
-
After
running the config step (above), you are encouraged to look through
the following two files and adjust their contents to suit your
preferences.
nano -w /usr/local/etc/toaster.conf
nano -w
/usr/local/etc/toaster-watcher.conf
-
Installing
Programs
-
Start
building the toaster! (run one at a time)
-
hash(bash)
or rehash(csh)
-
cd
/usr/local/src/Mail-Toaster-*
bin/toaster_setup.pl -s pre
qmail
menu: choose all patches
daemontools menu: choose defaults
-
bin/toaster_setup.pl
-s mysql
say (n) at first promt to build from source
-
bin/toaster_setup.pl
-s apache
-
bin/toaster_setup.pl
-s webmail
rsync menu: choose defaults
y/n menu: yes to
overwrite /usr/local/www/toaster
-
bin/toaster_setup.pl
-s ucspi
yes to any y/n prompts
-
bin/toaster_setup.pl
-s ezmlm
-
bin/toaster_setup.pl
-s vpopmail
-
bin/toaster_setup.pl
-s maildrop
-
bin/toaster_setup.pl
-s qmailadmin
-
bin/toaster_setup.pl
-s qmail
-
Install
Web/POP3/IMAP servers
-
Install
dovecot
-
bin/toaster_setup.pl -s dovecot
dovecot menu: enable vpopmail support
(I chose dovecot because it has proven more stable and handles malformed messages with more grace aka lest customer calls)
-
Also
a webmail client or three:
bin/toaster_setup.pl -s
squirrelmail
bin/toaster_setup.pl -s sqwebmail
sqwebmail
menu: enable auth_vchkpw
bin/toaster_setup.pl -s
roundcube
roundcube menu:
add spell check
-
Install
Filtering
-
bin/toaster_setup.pl -s filter
-
Install
logging
-
Set
up logging
bin/toaster_setup.pl
-s maillogs
bin/toaster_setup.pl
-s supervise
bin/toaster_setup.pl
-s rrdutil
rrdutil menu: choose defaults
ucd_snmp menu:
choose defaults
ucd_snmp questions: hit enter for all
-
-
crontab -u root -e
40 * * * * /usr/local/share/sqwebmail/cleancache.pl
*/5 * * * * /usr/local/sbin/toaster-watcher.pl
*/5 * * * * /usr/local/www/cgi-bin/rrdutil.cgi -a update
-
Configuration
-
Edit /usr/local/etc/rc.d/apache22/extras/httpd-ssl.conf
-
change the crt and key files to exist inside ssl.crt and ssl.key subdirectories.
-
Add
a domain
~vpopmail/bin/vadddomain example.com
[password]
~vpopmail/bin/vadduser user@example.com [password]
-
Test
-
bin/toaster_setup.pl
-s test
run all tests: ignore failures
-
Send
some email
mail
user@example.com
Subject:
test
test
ls
~vpopmail/domains/example.com/user/Maildir/*
You
should see a file in the new directory. If not, open up another
terminal to the mail server and watch the mail log files with
tail:
tail
-f /var/log/mail/send/current
tail -f /var/log/maillog
-
Setup
SimScan
-
Edit
/usr/local/vpopmail/etc/tcp.smtp
Change the following
line:
:allow
to
look like this
:allow,QMAILQUEUE="/var/qmail/bin/simscan"
save
the file
qmailctl
cdb && qmailctl restart
(I
chose simscan because it is a c bianry not a script that uses
craploads of memory. Also simscan will scan the email as it enters
the server, rejecting it at the smtp level never letting exessive
resources be used by mailscanning)
-
rc.conf configuration
-
Edit you rc.conf file and add these lines, removing any previous directives that are duplicates of these below.
apache22_enable="YES"
apache22ssl_enable="YES"
check_quotas="YES"
clamav_clamd_enable="YES"
clamav_freshclam_enable="YES"
courier_authdaemond_enable="YES"
courier_imap_imapd_enable="YES"
courier_imap_imapd_ssl_enable="YES"
courier_imap_imapdssl_enable="YES"
#old
courier_imap_pop3d_ssl_enable="YES"
courier_imap_pop3dssl_enable="YES"
#old
dovecot_enable="YES"
enable_quotas="YES"
hostname="fbsd.virtdomain.local"
ifconfig_le0="DHCP"
ipf_rules="/etc/ipf.rules"
ipfilter_enable="YES"
linux_enable="YES"
mysql_enable="YES"
mysqld_enable="YES"
ntpdate="YES"
sendmail_enable="NONE"
snmpd_enable="YES"
spamd_enable="YES"
spamd_flags="-d
-v -q -x -r /var/run/spamd.pid"
spamd_flags="-v
-x"
sqwebmaild_enable="YES"
sshd_enable="YES"
stunnel_enable="YES"
svscan_enable="YES"
xntpd_enable="YES"
xntpd_flags="-p
/var/run/ntpd.pid"
-
Reboot