Deprecated: Assigning the return value of new by reference is deprecated in /home/bnilsen/valhalla.net.nz/wiki/libs/Wakka.class.php on line 176

Deprecated: Assigning the return value of new by reference is deprecated in /home/bnilsen/valhalla.net.nz/wiki/libs/Wakka.class.php on line 463

Deprecated: Function set_magic_quotes_runtime() is deprecated in /home/bnilsen/valhalla.net.nz/wiki/wikka.php on line 120
<br /> <b>Deprecated</b>: Function ereg() is deprecated in <b>/home/bnilsen/valhalla.net.nz/wiki/libs/Wakka.class.php</b> on line <b>648</b><br /> Valhalla: Bjorn's Linux Qmail Toaster

Valhalla : QmailToaster

HomePage :: Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register

Bjorn's Linux Qmail Toaster


Huge credit goes to: Bill Shupp8
License: http://www.opencontent.org/opl.shtml8

Install Debian 3.1 with just the first CD. The part of the 1st stage of the the installer that requires any consideration is paritioning. I use 4 partitions: "/" swap "/var" and "/home". My server has a 72G of space so it is partitioned like this:

Deprecated: Function split() is deprecated in /home/bnilsen/valhalla.net.nz/wiki/actions/table.php on line 26

Deprecated: Assigning the return value of new by reference is deprecated in /home/bnilsen/valhalla.net.nz/wiki/3rdparty/core/safehtml/classes/safehtml.php on line 308

Deprecated: Assigning the return value of new by reference is deprecated in /home/bnilsen/valhalla.net.nz/wiki/3rdparty/core/safehtml/classes/HTMLSax.php on line 159

Deprecated: Assigning the return value of new by reference is deprecated in /home/bnilsen/valhalla.net.nz/wiki/3rdparty/core/safehtml/classes/HTMLSax.php on line 161

Deprecated: Assigning the return value of new by reference is deprecated in /home/bnilsen/valhalla.net.nz/wiki/3rdparty/core/safehtml/classes/HTMLSax.php on line 162

Deprecated: Assigning the return value of new by reference is deprecated in /home/bnilsen/valhalla.net.nz/wiki/3rdparty/core/safehtml/classes/HTMLSax.php on line 163

Deprecated: Assigning the return value of new by reference is deprecated in /home/bnilsen/valhalla.net.nz/wiki/3rdparty/core/safehtml/classes/HTMLSax.php on line 165

Deprecated: Assigning the return value of new by reference is deprecated in /home/bnilsen/valhalla.net.nz/wiki/3rdparty/core/safehtml/classes/HTMLSax.php on line 166

Deprecated: Assigning the return value of new by reference is deprecated in /home/bnilsen/valhalla.net.nz/wiki/3rdparty/core/safehtml/classes/HTMLSax.php on line 167

Deprecated: Assigning the return value of new by reference is deprecated in /home/bnilsen/valhalla.net.nz/wiki/3rdparty/core/safehtml/classes/HTMLSax.php on line 243

Deprecated: Assigning the return value of new by reference is deprecated in /home/bnilsen/valhalla.net.nz/wiki/3rdparty/core/safehtml/classes/HTMLSax.php on line 250

Deprecated: Assigning the return value of new by reference is deprecated in /home/bnilsen/valhalla.net.nz/wiki/3rdparty/core/safehtml/classes/HTMLSax.php on line 259

Deprecated: Assigning the return value of new by reference is deprecated in /home/bnilsen/valhalla.net.nz/wiki/3rdparty/core/safehtml/classes/HTMLSax.php on line 266

Deprecated: Assigning the return value of new by reference is deprecated in /home/bnilsen/valhalla.net.nz/wiki/3rdparty/core/safehtml/classes/HTMLSax.php on line 273

Deprecated: Assigning the return value of new by reference is deprecated in /home/bnilsen/valhalla.net.nz/wiki/3rdparty/core/safehtml/classes/HTMLSax.php on line 280

Deprecated: Assigning the return value of new by reference is deprecated in /home/bnilsen/valhalla.net.nz/wiki/3rdparty/core/safehtml/classes/HTMLSax.php on line 467

Deprecated: Assigning the return value of new by reference is deprecated in /home/bnilsen/valhalla.net.nz/wiki/3rdparty/core/safehtml/classes/HTMLSax.php on line 469

Deprecated: Assigning the return value of new by reference is deprecated in /home/bnilsen/valhalla.net.nz/wiki/3rdparty/core/safehtml/classes/HTMLSax.php on line 471
partition size
/ 5G
swap 2G
/var 10G
/home 55G

-partitioning
-hostname
-domain name
- static IP address
- Skip package selection as we will install the packages manually

At this stage I install SSH and my favourite text editor so I can do the rest of the work from my desk.
apt-get install ssh vim

Configure apt sources to something local and fast, also include a debian volatile source for clamav updates.
edit /etc/apt/sources.list
deb http://ftp.tranzpeer.net/debian stable main contrib non-free
deb http://ftp.tranzpeer.net/debian-non-US stable/non-US main contrib non-free
deb http://ftp.tranzpeer.net/debian-security stable/updates main contrib non-free
deb http://public.planetmirror.com/pub/debian-volatile stable/volatile main (for clamav)
deb http://www.backports.org/debian/ sarge-backports main

edit /etc/apt/preferences
Package: *
Pin: release a=sarge-backports
Pin-Priority: 200

Package: spamassassin
Pin: release a=sarge-backports
Pin-Priority: 999

Package: spamc
Pin: release a=sarge-backports
Pin-Priority: 999

apt-get update
apt-get upgrade

Install Debian packages
apt-get install libgdbm-dev gcc g++ patch make libc-dev stunnel libssl-dev apache2 \
	php4 wget bzip2 host telnet less lftp mysql-server-4.1 libmysqlclient14-dev phpmyadmin \
	 libapache2-mod-php4 unzip spamc spamassassin razor pyzor clamav-daemon\
	  clamav-freshclam clamav arj unzoo maildrop ntpdate php4-pear maildrop \
	libnet-ident-perl libio-socket-ssl-perl dcc-client libmail-spf-query-perl libsys-hostname-long-perl

Set mysql root password
mysqladmin -u root password PASSWORD

Debian requires an MTA package and as we are installing Qmail from source we will install a dummy one.
# install equivs
apt-get install equivs

# build the dummy mta package
cd /tmp
cp /usr/share/doc/equivs/examples/mail-transport-agent.ctl .
equivs-build mail-transport-agent.ctl

# remove exim4
dpkg --ignore-depends=exim4 -r exim4
dpkg --ignore-depends=exim4-daemon-light -r exim4-daemon-light

# and install the dummy mta package
dpkg -i /tmp/mta-local_1.0_all.deb

Configure SSL on Apache
http://mario.espaciolinux.com/apache2_ssl.html8
http://ilovett.com/blog/projects/linux/installing-ssl-on-debian-apache28
apache2-ssl-certificate
edit /etc/apache2/ports.conf add line "Listen 443"

cp /etc/apache2/sites-available/default /etc/apache2/sites-available/ssl

edit /etc/apache2/sites-available/ssl
#NameVirtualHost *
<VirtualHost *:443>
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/apache.pem

edit /etc/apache2/sites-available/default
#NameVirtualHost *
<VirtualHost *:80>

a2ensite ssl
a2enmod ssl

Courier-imap's startup script likes to use a different lock directory, so we'll just create it:
mkdir /var/lock/subsys


Download packages

     mkdir -p /usr/src/tar
	cd /usr/src/tar

	wget http://cr.yp.to/daemontools/daemontools-0.76.tar.gz
	wget http://cr.yp.to/ucspi-tcp/ucspi-tcp-0.88.tar.gz
	wget http://shupp.org/software/netqmail-1.05.tar.gz
	wget http://shupp.org/patches/qmail-toaster-0.8.patch.bz2
	wget http://shupp.org/software/autorespond-2.0.4.tar.gz
	wget http://shupp.org/patches/autorespond-2.0.4-2.0.5.patch
	wget http://shupp.org/software/qmailadmin-1.2.9.tar.gz
	wget http://shupp.org/software/qmailadmin-help-1.0.8.tar.gz
	wget http://cr.yp.to/software/ezmlm-0.53.tar.gz
	wget http://shupp.org/software/ezmlm-idx-0.443.tar.gz
	wget http://shupp.org/software/courier-imap-4.0.4.tar.bz2
	wget http://shupp.org/software/courier-authlib-0.57.tar.bz2
	wget http://shupp.org/software/squirrelmail-1.4.5.tar.bz2
	wget http://shupp.org/software/quota_usage-1.3-1.2.7.tar.gz
	wget http://shupp.org/software/toaster-scripts-0.8.tar.gz
	wget http://optusnet.dl.sourceforge.net/sourceforge/vpopmail/vpopmail-5.4.13.tar.gz
	cd ../
	tar -xzf tar/netqmail-1.05.tar.gz
	cd netqmail-1.05
	./collate.sh 

Install Software


daemontools
mkdir -p /package
chmod 1755 /package
cd /package
tar -xpzf /usr/src/tar/daemontools-0.76.tar.gz
cd admin/daemontools-0.76
patch -p1 < /usr/src/netqmail-1.05/other-patches/daemontools-0.76.errno.patch
package/install


ucspi-tcp
 cd /usr/src/
tar -xzf tar/ucspi-tcp-0.88.tar.gz
cd ucspi-tcp-0.88
patch -p1 < /usr/src/netqmail-1.05/other-patches/ucspi-tcp-0.88.errno.patch
make
make setup check


qmail
Install:
mkdir /var/qmail
groupadd nofiles
useradd -g nofiles -d /var/qmail/alias alias
useradd -g nofiles -d /var/qmail qmaild
useradd -g nofiles -d /var/qmail qmaill
useradd -g nofiles -d /var/qmail qmailp
groupadd qmail
useradd -g qmail -d /var/qmail qmailq
useradd -g qmail -d /var/qmail qmailr
useradd -g qmail -d /var/qmail qmails

cd /usr/src
tar -xzf tar/toaster-scripts-0.8.tar.gz
cd netqmail-1.05/netqmail-1.05/

make
make setup check
# NOTE: qmail will be patched AFTER vpopmail is installed

# turn on SPF checking
echo 3 > /var/qmail/control/spfbehavior

# Setup the primary administrator's email address.
# This address will receive mail for root, postmaster, and mailer-daemon.
# Replace "admin@example.com" with your email address
(cd ~alias; echo "admin@example.com" > .qmail-postmaster ;\
echo "admin@example.com" > .qmail-mailer-daemon ;\
echo "admin@example.com" > .qmail-root )
chmod 644 ~alias/.qmail*

# on the next line replace "full.hostname" with the hostname of your mail server
./config-fast full.hostname

Configure:
	 cd /usr/src
	cp toaster-scripts-0.8/rc /var/qmail/rc
	chmod 755 /var/qmail/rc
	mkdir /var/log/qmail
	echo ./Maildir/ >/var/qmail/control/defaultdelivery
	cp toaster-scripts-0.8/qmailctl /var/qmail/bin/
	chmod 755 /var/qmail/bin/qmailctl
	ln -s /var/qmail/bin/qmailctl /usr/bin
	ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail
	ln -s /var/qmail/bin/sendmail /usr/lib/sendmail

	#Now create the supervise directories/scripts for the qmail services:
	mkdir -p /var/qmail/supervise/qmail-send/log
	mkdir -p /var/qmail/supervise/qmail-smtpd/log
	mkdir -p /var/qmail/supervise/qmail-pop3d/log
	mkdir -p /var/qmail/supervise/qmail-pop3ds/log
	cp /usr/src/toaster-scripts-0.8/send.run /var/qmail/supervise/qmail-send/run
	cp /usr/src/toaster-scripts-0.8/send.log.run /var/qmail/supervise/qmail-send/log/run
	cp /usr/src/toaster-scripts-0.8/smtpd.run /var/qmail/supervise/qmail-smtpd/run
	cp /usr/src/toaster-scripts-0.8/smtpd.log.run /var/qmail/supervise/qmail-smtpd/log/run
	cp /usr/src/toaster-scripts-0.8/pop3d.run /var/qmail/supervise/qmail-pop3d/run
	cp /usr/src/toaster-scripts-0.8/pop3d.log.run /var/qmail/supervise/qmail-pop3d/log/run
	cp /usr/src/toaster-scripts-0.8/pop3ds.run /var/qmail/supervise/qmail-pop3ds/run
	cp /usr/src/toaster-scripts-0.8/pop3ds.log.run /var/qmail/supervise/qmail-pop3ds/log/run
	echo 20 > /var/qmail/control/concurrencyincoming
	chmod 644 /var/qmail/control/concurrencyincoming
	chmod 755 /var/qmail/supervise/qmail-send/run
	chmod 755 /var/qmail/supervise/qmail-send/log/run
	chmod 755 /var/qmail/supervise/qmail-smtpd/run
	chmod 755 /var/qmail/supervise/qmail-smtpd/log/run
	chmod 755 /var/qmail/supervise/qmail-pop3d/run
	chmod 755 /var/qmail/supervise/qmail-pop3d/log/run
	chmod 755 /var/qmail/supervise/qmail-pop3ds/run
	chmod 755 /var/qmail/supervise/qmail-pop3ds/log/run
	mkdir -p /var/log/qmail/smtpd
	mkdir -p /var/log/qmail/pop3d
	mkdir -p /var/log/qmail/pop3ds
	chown -R qmaill /var/log/qmail

	#allow daemontools to start qmail
	ln -s /var/qmail/supervise/qmail-send /var/qmail/supervise/qmail-smtpd /service

	#verify that it's running with qmailctl
	sleep 5
	qmailctl stat 


vpopmail
Create database:
mysql -p
	CREATE DATABASE vpopmail;
	GRANT select,insert,update,delete,create,drop ON vpopmail.*
	TO vpopmail@localhost IDENTIFIED BY 'PASSWORD';
	quit

groupadd -g 89 vchkpw
	useradd -u 89 -g vchkpw vpopmail
	
mkdir ~vpopmail
chown vpopmail.vchkpw ~vpopmail
mkdir ~vpopmail/etc
chown vpopmail.vchkpw ~vpopmail/etc
echo "localhost|0|vpopmail|PASSWORD|vpopmail" > ~vpopmail/etc/vpopmail.mysql
chown vpopmail.vchkpw ~vpopmail/etc/vpopmail.mysql
chmod 640 ~vpopmail/etc/vpopmail.mysql

Install:
     	cd /usr/src
	tar -xzf tar/vpopmail-5.4.13.tar.gz
	cd vpopmail-5.4.13

	./configure --enable-auth-module=mysql --enable-mysql-limits \
	--enable-learn-passwords --enable-valias --enable-logging=y \
	--enable-qmail-ext --enable-sql-logging --enable-libdir=/usr/lib
	make
	make install-strip
	echo '127.:allow,RELAYCLIENT=""' > ~vpopmail/etc/tcp.smtp
	(cd ~vpopmail/etc ; tcprules tcp.smtp.cdb tcp.smtp.tmp < tcp.smtp)

	# install the vpopmail start script
	cp ../toaster-scripts-0.8/vpopmailctl /var/qmail/bin/vpopmailctl

	chmod 755 /var/qmail/bin/vpopmailctl
	ln -s /var/qmail/bin/vpopmailctl /usr/bin

	# add qmail toaster patch now that vpopmail is installed
	cd /usr/src/netqmail-1.05/netqmail-1.05
	bunzip2 -c ../../tar/qmail-toaster-0.8.patch.bz2 | patch -p0
	make clean
	make
	qmailctl stop
	make setup check

	# NOTE: the following command needs to be run after any future
	# re-installs of qmail as it will chown this directory back to qmail

	chown -R vpopmail:vchkpw /var/qmail/spam

	make cert
	# enter your company's information
	make tmprsadh
	# NOTE: This may take a LONG time

	# now add the followowing line to your crontab via `crontab -e` to update these temp keys each night
	01 01 * * * /var/qmail/bin/update_tmprsadh > /dev/null 2>&1

	# start qmail back up
	qmailctl start

	#allow daemontools to start vpopmail
	ln -s /var/qmail/supervise/qmail-pop3d /var/qmail/supervise/qmail-pop3ds /service

	#verify that it's running with vpopmailctl
	sleep 5
	vpopmailctl stat 

Courier-IMAP
Install Courier's Auth Library:
	cd /usr/src
	tar -xjf tar/courier-authlib-0.57.tar.bz2
	cd courier-authlib-0.57
	./configure
	# NOTE: RedHat/Fedora users need to add "--with-redhat"

	make
	make install-strip
	make install-configure

	cp courier-authlib.sysvinit /etc/init.d/courier-authlib
	chmod 755 /etc/init.d/courier-authlib
	ln -s ../init.d/courier-authlib /etc/rc0.d/K30courier-authlib
	ln -s ../init.d/courier-authlib /etc/rc1.d/K30courier-authlib
	ln -s ../init.d/courier-authlib /etc/rc2.d/S80courier-authlib
	ln -s ../init.d/courier-authlib /etc/rc3.d/S80courier-authlib
	ln -s ../init.d/courier-authlib /etc/rc4.d/S80courier-authlib
	ln -s ../init.d/courier-authlib /etc/rc5.d/S80courier-authlib
	ln -s ../init.d/courier-authlib /etc/rc6.d/K30courier-authlib

Configure:
	Edit /usr/local/etc/authlib/authdaemonrc
	    * Change authmodulelist="..." to authmodulelist="authvchkpw" 

Start Authlib's Authdaemon Server
	/etc/init.d/courier-authlib start

Install Courier-IMAP:
	cd /usr/src
	tar -xjf tar/courier-imap-4.0.4.tar.bz2
	cd courier-imap-4.0.4
	# build as vpopmail
	chown -R vpopmail:vchkpw ../courier-imap-4.0.4
	su vpopmail
	# configure may take some time...
	./configure
	# NOTE: RedHat/Fedora users need to add "--with-redhat"

	make
	exit
	make install-strip
	make install-configure

	cp courier-imap.sysvinit /etc/init.d/courier-imap
	chmod 755 /etc/init.d/courier-imap
	ln -s ../init.d/courier-imap /etc/rc0.d/K30courier-imap
	ln -s ../init.d/courier-imap /etc/rc1.d/K30courier-imap
	ln -s ../init.d/courier-imap /etc/rc2.d/S80courier-imap
	ln -s ../init.d/courier-imap /etc/rc3.d/S80courier-imap
	ln -s ../init.d/courier-imap /etc/rc4.d/S80courier-imap
	ln -s ../init.d/courier-imap /etc/rc5.d/S80courier-imap
	ln -s ../init.d/courier-imap /etc/rc6.d/K30courier-imap

Configure:
	Edit /usr/lib/courier-imap/etc/imapd

	    * Change 'IMAPDSTART=NO' to 'IMAPDSTART=YES' 

	Edit /usr/lib/courier-imap/etc/imapd-ssl

	    * Change 'IMAPDSSLSTART=NO' to 'IMAPDSSLSTART=YES' 

	# optional: The first time courier-imap is started, the SSL certificate
	# is first created using "localhost" as the "common name".
	# If you want to change this to match your hostname, you can customize
	# the CN line in /usr/lib/courier-imap/etc/imapd.cnf (and pop3d.cnf of
	# you choose to use courier's pop3d) so that the common name matches
	# your server name BEFORE you start the server for the first time

Start IMAP server
	/etc/init.d/courier-imap start


autorespond
Install:
	cd /usr/src
	tar -xzf tar/autorespond-2.0.4.tar.gz
	cd autorespond-2.0.4
	patch -p1 < ../tar/autorespond-2.0.4-2.0.5.patch
	make
	make install


ezmlm-idx

Install:
	cd /usr/src
	tar -xzf tar/ezmlm-0.53.tar.gz
	tar -xzf tar/ezmlm-idx-0.443.tar.gz
	mv ezmlm-idx-0.443/* ezmlm-0.53/
	cd ezmlm-0.53
	patch -p0 < idx.patch
	make
	make setup


qmailadmin

Install:
	cd /usr/src
	tar -xzf tar/qmailadmin-1.2.9.tar.gz
	cd qmailadmin-1.2.9
	./configure --enable-help \
	   --enable-htmldir=/var/www \
	   --enable-cgibindir=/usr/lib/cgi-bin \
	   --enable-modify-spam \
	   --enable-spam-command="|/var/qmail/bin/preline /usr/bin/maildrop /home/vpopmail/etc/mailfilter"
	make
	make install-strip

	cd ../
	tar -xzf tar/qmailadmin-help-1.0.8.tar.gz
	cd qmailadmin-help-1.0.8
	mkdir /var/www/images/qmailadmin/help
	cp -rp * /var/www/images/qmailadmin/help 


Configure spam filter
edit /home/vpopmail/etc/mailfilter

if (/^X-Spam-Flag: *Yes/)
{
	    `test -d Maildir/.Spam`
	    if( $RETURNCODE == 1 )
	    {
	            `/usr/bin/maildirmake -f Spam Maildir`
	            `echo "INBOX.Spam" >> Maildir/courierimapsubscribed`
	    }
	    exception {
	            to "Maildir/.Spam/"
	    }
	    # if all else fails, do regular delivery
	    exception {
	            to "Maildir/"
	    }
}
else
{
	    exception {
	            to "Maildir/"
	    }
}

chown vpopmail:vchkpw /home/vpopmail/etc/mailfilter


spamassassin

Configure:
edit /etc/default/spamassassin
   ENABLED=1
   OPTIONS="-q -x -m 5 -H"

edit /etc/spamassassin/local.cf
   user_scores_dsn                  DBI:mysql:vpopmail:localhost
   user_scores_sql_password         spam
   user_scores_sql_username         PASSWORD
   user_scores_sql_custom_query     SELECT preference, value FROM spamassassin WHERE
 username = _USERNAME_ OR username = '$GLOBAL' OR username = CONCAT('%',_DOMAIN_) ORDER BY username ASC

Create database table:
create this table in the vpopmail database

mysql -p
use vpopmail

CREATE TABLE spamassassin (
  username varchar(100) NOT NULL default '',
  preference varchar(30) NOT NULL default '',
  value varchar(100) NOT NULL default '',
  prefid int(11) NOT NULL auto_increment,
  PRIMARY KEY  (prefid),
  INDEX (username)
) TYPE=MyISAM;

GRANT select,insert,update,delete ON vpopmail.spamassassin TO spam@localhost IDENTIFIED BY 'PASSWORD';

INSERT INTO spamassassin (username, preference, value) VALUES ('$GLOBAL', 'required_hits', '5');
INSERT INTO spamassassin (username, preference, value) VALUES ('$GLOBAL', 'required_score', '5.0');
INSERT INTO spamassassin (username, preference, value) VALUES ('$GLOBAL', 'use_bayes', '1');
INSERT INTO spamassassin (username, preference, value) VALUES ('$GLOBAL', 'bayes_path', '5.0');
INSERT INTO spamassassin (username, preference, value) VALUES ('$GLOBAL', 'required_score', 
'/etc/mail/spamassassin/.spamassassin/baye');
INSERT INTO spamassassin (username, preference, value) VALUES ('$GLOBAL', 'bayes_auto_learn_threshold_spa', '8.0');
INSERT INTO spamassassin (username, preference, value) VALUES ('$GLOBAL', 'ok_languages', 'all');
INSERT INTO spamassassin (username, preference, value) VALUES ('$GLOBAL', 'ok_locales', 'all');
INSERT INTO spamassassin (username, preference, value) VALUES ('$GLOBAL', 'add_header', 'spam Flag _YESNO_');
INSERT INTO spamassassin (username, preference, value) VALUES ('$GLOBAL', 'report_safe', '0');
INSERT INTO spamassassin (username, preference, value) VALUES ('$GLOBAL', 'add_header', 'all Level _STARS(+)_');

quit


Start her up!
/etc/init.d/spamassassin start


Install Rules Du Jour8
cd /usr/src/tar
wget http://sandgnat.com/rdj/rules_du_jour
cp rules_du_jour /usr/local/sbin/rules_du_jour
chmod +x /usr/local/sbin/rules_du_jou
mkdir /etc/rulesdujourr


Configure Rules Du Jour
edit /etc/rulesdujour/config

TRUSTED_RULESETS="TRIPWIRE SARE_EVILNUMBERS0 RANDOMVAL BOGUSVIRUS SARE_ADULT SARE_FRAUD SARE_BML SARE_SPOOF SARE_BAYES_POISON_NXM SARE_OEM SARE_RANDOM SARE_HEADER0 SARE_HTML0 SARE_SPECIFIC SARE_REDIRECT_POST300 SARE_SPAMCOP_TOP200 SARE_GENLSUBJ0 SARE_OBFU0 SARE_URI0 SARE_WHITELIST"
SA_DIR="/etc/mail/spamassassin"
MAIL_ADDRESS="postmaster@mail.manux.net.nz"
SA_RESTART="killall -HUP spamd"


Schedule updates
crontab -e

37 2 * * * /usr/local/sbin/rules_du_jour /dev/null 2>&1


ripmime

Install:
	cd /usr/src/tar
	wget http://shupp.org/software/ripmime-1.4.0.5.tar.gz
	cd ..
	tar -xzf tar/ripmime-1.4.0.5.tar.gz
	cd ripmime-1.4.0.5
	make
	make install


simscan

Patch Qmail so we can have a custom smtp-reject:
cd /usr/src/tar
wget http://shupp.org/patches/custom.patch
patch -p1 < custom.patch
cd /usr/src/netqmail-1.05/netqmail-1.05
make clean
make
qmailctl stop
make setup check
qmailctl start


Install:
cd /usr/src/tar
wget http://shupp.org/software/simscan-1.1.tar.gz
cd ../
tar -xzf tar/simscan-1.1.tar.gz
cd simscan-1.1

./configure --enable-user=clamav \
--enable-clamav=y \
--enable-spam=y \
--enable-spam-hits=20 \
--enable-spamc-user=y \
--enable-per-domain=y \
--enable-ripmime \
--enable-attach=y \
--enable-received=y \
--enable-custom-smtp-reject=y

make
make install-strip


Configure:
# add default rules for simscan
echo ":clam=yes,spam=yes,spam_hits=30,attach=.vbs:.lnk:.scr:.wsh:.hta:.pif" > /var/qmail/control/simcontrol
# update /var/qmail/control/simcontrol.cdb
/var/qmail/bin/simscanmk
# put versions for received header in /var/qmail/control/simversions.cdb
/var/qmail/bin/simscanmk -g

# turn on scanning
echo ':allow,QMAILQUEUE="/var/qmail/bin/simscan"' >> ~vpopmail/etc/tcp.smtp
qmailctl cdb

# put "/var/qmail/bin/simscanmk -g" into cron hourly
01 * * * * /var/qmail/bin/simscanmk -g > /dev/null 2>&1


vqadmin

Go to http://sourceforge.net/projects/vqadmin/8 and download vqadmin and the 2 patches: "valias support" and "dir_control fix, vlimits, pretty quotas" and put them in the folder /usr/src/tar.

wget http://optusnet.dl.sourceforge.net/sourceforge/vqadmin/vqadmin-2.3.6.tar.gz


Install:
cd /usr/src
tar zxf tar/vqadmin-2.3.6.tar.gz
cd vqadmin-2.3.6/

patch -p0 < ../tar/vqadmin-2.patch
patch -p1 < ../tar/vqadmin-2.3.6-valias.patch

# configure database settings
edit db_owner.c
./configure --enable-mysql=y --enable-cgibindir=/usr/lib/cgi-bin
make
make install-strip


Configure Apache
edit /etc/apache2/conf.d/vqadmin.conf

   <Directory "/usr/lib/cgi-bin/vqadmin">
	   deny from all
	   Options ExecCGI
	   AllowOverride AuthConfig
	   Order deny,allow
   </Directory>

/etc/init.d/apache2 restart

edit /usr/lib/cgi-bin/vqadmin/.htaccess
 AuthType Basic
 AuthUserFile /home/vpopmail/etc/vqadmin.passwd
 AuthName vQadmin
 require valid-user
 satisfy any

htpasswd -bc /home/vpopmail/etc/vqadmin.passwd admin PASSWORD

#configure password in acl file
edit /usr/lib/cgi-bin/vqadmin/vqadmin.acl


Create domain owner table
mysql -p
use vpopmail

	       CREATE TABLE domain_owner (
	            domain CHAR(64) NOT NULL,
	            owner CHAR(32) NOT NULL,
	            PRIMARY KEY(domain, owner)
	            );


squirrelmail

Download files:
nutsmail_silver145.tar.gz from http://www.nutsmail.com/8 (you have to buy it)
qmailadmin_login-1.1-1.4.3.tar.gz from squirrelmail.org
sasql-3.1.2.tar.gz from www.squirrelmail.org
put them all into /usr/src/tar

Create database:
mysql -p

create database squirrelmail;

GRANT select,insert,update,delete ON squirrelmail.* TO squirreluser@localhost IDENTIFIED BY 'PASSWORD';

   CREATE TABLE address (
	 owner varchar(128) DEFAULT '' NOT NULL,
	 nickname varchar(16) DEFAULT '' NOT NULL,
	 firstname varchar(128) DEFAULT '' NOT NULL,
	 lastname varchar(128) DEFAULT '' NOT NULL,
	 email varchar(128) DEFAULT '' NOT NULL,
	 label varchar(255),
	 PRIMARY KEY (owner,nickname),
	 KEY firstname (firstname,lastname)
   );

  CREATE TABLE userprefs (
	user varchar(128) DEFAULT '' NOT NULL,
	prefkey varchar(64) DEFAULT '' NOT NULL,
	prefval BLOB DEFAULT '' NOT NULL,
	PRIMARY KEY (user,prefkey)
  );


Install:
mkdir /var/www/webmail
cd /var/www/webmail/
tar zxf /usr/src/tar/nutsmail_silver145.tar.gz
mv data /var/squirreldata
chown -R www-data:www-data /var/squirreldata


Configure:
edit the config/config.php
	(28) $license="000000000000";
	(35) $org_name = "Manux Networks WebMail";
	(61) $org_title = "Manux Networks WebMail";
	(74) $signout_page = 'http://www.manux.net.nz';
	(118)	$domain = '';
	(140) $useSendmail = true;
	(198) $imap_server_type = 'courier';
	(277) $default_folder_prefix = 'INBOX.';
	(329) $trash_folder = 'Trash';
	(330) $sent_folder  = 'Sent';
	(331) $draft_folder = 'Drafts';
	(429)	$data_dir = '/var/squirreldata/';
	(799) $addrbook_dsn = 'mysql://squirreluser:PASSWORD@localhost/squirrelmail';
	(804) $prefs_dsn = 'mysql://squirreluser:PASSWORD@localhost/squirrelmail';
	    Comment out all themes except number 38
	    comment out spamcop (774)//$plugins[18] = 'spamcop';

edit plugins/filters/setup.php
	    (50) $AllowSpamFilters = false;


Install plugins:
cd /var/www/webmail/plugins
tar zxf /usr/src/tar/qmailadmin_login-1.1-1.4.3.tar.gz
tar zxf /usr/src/tar/sasql-3.1.2.tar.gz


Configure plugins:
cd /var/www/nutsmail/plugins/sasql
cp sasql_conf.php.dist sasql_conf.php
edit sasql_conf.php
   $SqlDSN = 'mysql://spam:PASSWORD@localhost/vpopmail';
   $SqlTable = 'spamassassin';
   $sasql_use_learn = False;
   // $learn_spam_folder = 'Learn Spam';
   // $learn_fp_folder = 'Learn FP';


edit config/config.php and add the following lines in the plugins section
   $plugins[26] = 'qmailadmin_login';
   $plugins[27] = 'sasql';
Valid XHTML 1.0 Transitional8 :: Valid CSS8 :: Powered by Wikka Wakka Wiki 1.1.6.38
Page was generated in 0.2133 seconds