Install Qmail
The Qmail license does not allow for binary distribution. So we need to compile from source to install qmail. This works out well as we will be applying a few patches to the source. Also, since we are adding TLS support, you will need to ensure that the openssl-devel package is installed.
- Required Packages
The qmail-spp patch provided above may not be included in the normal qmail-spp distribution. This version is patched against netqmail 1.05 with the smtp-auth tls patch. I have provided a link to the qmail-spp homepage for further information regarding qmail-spp.
First add the qmail users.
Note : The uid and gid numbers I've indicated below are my preference. There is no "standard" for this that I have been able to find. My standard is here. If you are creating a Qmail cluster, do yourself a favor and make sure the uid/gid's are the same across all of the servers. This will save you from some VERY large headaches, I promise.
rootshell> mkdir /var/qmail
rootshell> groupadd -g 310 nofiles
rootshell> useradd -g nofiles -d /var/qmail/alias -u 312 alias
rootshell> useradd -g nofiles -d /var/qmail -u 313 qmaild
rootshell> useradd -g nofiles -d /var/qmail -u 314 qmaill
rootshell> useradd -g nofiles -d /var/qmail -u 315 qmailp
rootshell> groupadd -g 311 qmail
rootshell> useradd -g qmail -d /var/qmail -u 316 qmailq
rootshell> useradd -g qmail -d /var/qmail -u 317 qmailr
rootshell> useradd -g qmail -d /var/qmail -u 318 qmails
Now that the users have been created, we need to uncompress, patch, and install Qmail. We recommend compiling all of your source in a central directory. We use /usr/local/src for our central directory.
shell> cd /usr/local/src
shell> tar zxvf netqmail-1.06.tar.gz
shell> tar zxvf qmail-spp-0.42.tar.gz
shell> cd netqmail-1.06
shell> patch -p0 < /path/to/netqmail-1.05-tls-smtpauth-20070417.patch
shell> patch -p0 < /path/to/qmail-spp-0.42-smtpauth-tls-20060105.patch
shell> make
The update_tmprsadh script creates temporary ssl certificates. These certificates are used for ssl authentication and need to be readable by qmail, pop3, and imap. By default, the certificates are owned by qmaild, so we need to change the ownership to vpopmail. The following command updates the necessary script.
shell> cat update_tmprsadh | sed s/qmaild\.qmail/vpopmail\.qmail/m > update_tmprsadh.tmp
shell> mv update_tmprsadh.tmp update_tmprsadh
shell> chmod 755 update_tmprsadh
Note for Redhat Users : If you get an excess of openssl errors when compiling, edit the conf-cc file and add -I/usr/kerberos/include at the end of the first line.
rootshell> make setup check
Replace hostname below with the full hostname of your server
rootshell> ./config-fast hostname
rootshell> make cert
rootshell> chown vpopmail.qmail /var/qmail/control/servercert.pem
Note : This next step may take a while
rootshell> make tmprsadh
That's all that needs to be done to install qmail. However, there is a bit of configuration to be done. See the configuration section for more information.