Create needed users/groups
After this step, you should have all the needed user and groups created as well as all the needed directories, permissions and ownership settings needed for the installation of qmail, ucspi-tcp and daemontools
Rather than being a single program, Qmail is a collection of smaller programs doing specific tasks. Each run as their own user to provide further security to your server - those users need to be created.
One thing to note - the numeric UID/GID values used by qmail and vpopmail are hard-coded into the programs when they are compiled. If you backup and restore your mails onto a different server (sample on this page), the UID and GID MUST HAVE THE SAME NUMERIC VALUE ON BOTH SERVERS! The easiest way to ensure this is to manually specify the values when the users and groups are created.
Check your /etc/passwd and /etc/groups files first to make sure the numbers given here aren't used. Most Linux systems use numbers >500 for "regular" users and <100 for "system" so we've picked a middle ground.
If you choose another UID/GID, do not forget to replace 89 when you 'll configure courier-authlib.
groupadd -g 162 qmail
groupadd -g 89 vchkpw
useradd -u 161 -g nofiles -d /var/qmail/alias -s /usr/sbin/nologin -c 'QMail alias user' alias
useradd -u 162 -g nofiles -d /var/qmail -s /usr/sbin/nologin -c 'QMail daemon user' qmaild
useradd -u 163 -g nofiles -d /var/qmail -s /usr/sbin/nologin -c 'QMail log user' qmaill
useradd -u 164 -g nofiles -d /var/qmail -s /usr/sbin/nologin -c 'QMail password user' qmailp
useradd -u 165 -g qmail -d /var/qmail -s /usr/sbin/nologin -c 'QMail queue user' qmailq
useradd -u 166 -g qmail -d /var/qmail -s /usr/sbin/nologin -c 'QMail remote user' qmailr
useradd -u 167 -g qmail -d /var/qmail -s /usr/sbin/nologin -c 'QMail send user' qmails
useradd -u 89 -g vchkpw -d /home/vpopmail -s /usr/sbin/nologin -c 'Vpopmail (virtual domains) user' vpopmail
mkdir /var/qmail
mkdir /usr/src/qmail
mkdir -p /var/log/qmail/qmail-send
mkdir -p /var/log/qmail/qmail-smtpd
mkdir -p /var/log/qmail/qmail-smtpdssl
chown -R qmaill:root /var/log/qmail
chmod -R 750 /var/log/qmail
Note that /var is normally a strange place to install programs. Dan Bernstein has a FAQ at to explain why he chooses this location (http://cr.yp.to/qmail/faq/install.html)
Install qmail, ucspi-tcp and ucspi-ssl
Users comments