Italiano English
Edit History Actions


Copy-Paste HowTo For qmail with ezmlm for Mailing List Management

Tested on Ubuntu

Note: This is not MY work, I am just readapting a tutorial from

Note2: This is a bad tutorial and use it at your own risk... It is mainly done in NOTE FORM and there is not much explenation of WHAT is being done... I suggest you refer to for the complete version :-)


Install packages

apt-get install apache2 php5 mysql-server phpmyadmin php5-mysql php5-cgi gcc g++ libc6-dev libc-dev libmudflap0-dev sudo make openssl libssl-dev patch patchutils

If you are asking why gcc AND g++, here is the answer:
g++ i figured is required for Maildrop which is one of the steps in this tutorial

Remove the following Packages

  • Postfix - uninstall it or disable it
  • Any POP service - This includes Qpopper or any POP service that may be running out of xinetd. If your're server has a POP service running, you will need to disable it.
  • Any SMTP services
  • It's ok to have Sendmail installed, because we'll uninstall it during the qmail installation.

Perl Modules Needed:

  • Digest::SHA1
  • Digest::HMAC
  • Net::DNS
  • Time::HiRes

  • HTML::Tagset
  • HTML::Parser

Firewall ports to be opened:

  • Outbound ports (tcp)
    • 25 - SMTP
    • 110 - POP services
    • 143 - IMAP
    • 783 - Spamassassin
    • 993 - IMAPS
  • Inbound Ports (tcp)
    • 25 - SMTP
    • 80 - HTTP
    • 110 - POP services
    • 143 - IMAP
    • 443 - HTTPS
    • 783 - Spamassassin
    • 993 - IMAPS

mkdir /downloads
cd /downloads
tar zxvf qmailrocks.tar.gz

see here for more details

Next run these scripts

cd /downloads/qmailrocks/scripts/install
cd /downloads/qmailrocks/scripts/util

If all ok proceed

Build qmail

cd /usr/src/qmail/qmail-1.03
make man && make setup check
./config-fast your_fqdn_hostname (ex: ./config-fast

Create a certificate

make cert

Set right ownership

chown -R vpopmail:qmail /var/qmail/control/clientcert.pem /var/qmail/control/servercert.pem

build ucspi-tcp...

cd /usr/src/qmail/ucspi-tcp-0.88/
make && make setup check

If you get an error do as follows:

cd /usr/src/qmail/ucspi-tcp-0.88/
patch < /downloads/qmailrocks/patches/ucspi-tcp-0.88.errno.patch
make && make setup check

Should be ok now... (at least for me...)

build the daemontools....

cd /package/admin/daemontools-0.76

Again if you get an error, run this (IT IS DIFFERENT FROM THE ONE ABOVE):

cd /package/admin/daemontools-0.76/src
patch < /downloads/qmailrocks/patches/daemontools-0.76.errno.patch
cd /package/admin/daemontools-0.76

Check if "svscanboot" is running:

ps -aux | grep svs

You should get something like this:

root      6576  0.0  0.2   2640  1256 ?        Ss   12:50   0:00 /bin/sh /command/svscanboot
root      6587  0.0  0.1   2852   708 pts/1    S+   12:53   0:00 grep svscanboot

Note: The second one is just the grep command... the first is what you are looking for.

Install ezmlm

cd /downloads/qmailrocks/
tar zxvf ezmlm-0.53-idx-0.41.tar.gz
cd ezmlm-0.53-idx-0.41
make && make setup

Install autoresponders

cd /downloads/qmailrocks
tar zxvf autorespond-2.0.5.tar.gz
cd autorespond-2.0.5
make && make install

Here I will install vpopmail WITHOUT MySQL support,
if you wish to integrate MySQL support into vpopmail (usually for handling several domains - ie. more than 50 let-s say - then please follow the instructions from this page. Thanks.

Configure Vpopmail

see ./configure --help for all config options, otherwise...

./configure --enable-logging=p
make && make install-strip


cd /downloads/qmailrocks
tar zxvf vqadmin-2.3.6.tar.gz
cd vqadmin-2.3.6
./configure --enable-cgibindir=/path/to/your/cgi-bin --enable-htmldir=/path/to/your/html/directory
(Example: ./configure --enable-cgibindir=/var/www/cgi-bin --enable-htmldir=/var/www/html )
make && make install-strip

add the following to your server's Apache configuration file (usually httpd.conf)

<Directory "/path/to/your/cgi-bin/vqadmin">
deny from all
Options ExecCGI
AllowOverride AuthConfig
Order deny,allow

In addition, within the Apache master config file you will want to set the "AllowOveride" option to "All". Example: AllowOverride All

 cd /path/to/your/cgi-bin/vqadmin 

Now you will want to create a .htaccess file to password protect the Vqadmin interface. There should already be a .htaccess file in the vqadmin directory, so all you need to do is configure it. We'll use the ever useful vi editor for this.

 vi .htaccess 

AuthType Basic
AuthUserFile /path/to/where/you/want/to/store/the/password/file/.htpasswd
AuthName vQadmin
require valid-user
satisfy any

 chown apache .htaccess  (you may need to change the chown to either "nobody", "apache" or "www" etc., depending on what user your installation of Apache is running as)

 chmod 644 .htaccess 

Now you need to create a corresponding .htpasswd file that's going to contain the username and encrypted password for the Vqadmin administrator...

htpasswd -bc /path/to/where/you/want/to/store/the/password/file/.htpasswd admin admin_password
chmod 644 /path/to/where/you/want/to/store/the/password/file/.htpasswd

Go to: log in with user admin and the password you provided...

If you get a 500 Internal Server Error try this: Go to where you stored the .htpasswd file and  cp .htpasswd vqadmin.passwd  Assign the right ownership to it, mine looks like this:

-rw-r--r-- 1 www-data www-data   20 2008-01-24 14:31 vqadmin.passwd


cd /downloads/qmailrocks
tar zxvf maildrop-1.6.3.tar.gz
cd maildrop-1.6.3
./configure --prefix=/usr/local --exec-prefix=/usr/local --enable-maildrop-uid=root --enable-maildrop-gid=vchkpw --enable-maildirquota
make && make install-strip && make install-man


cd /downloads/qmailrocks
tar zxvf qmailadmin-1.2.9.tar.gz
cd qmailadmin-1.2.9
./configure --enable-cgibindir=/path/to/your/cgi-bin --enable-htmldir=/path/to/your/html/directory

note: The paths in the above configure script will need to be custom tailored to your systems configuration

make && make install-strip