Pick a Free OS

User login


qmail: A fast secure mail server

by all email clients. The disadvantage is that it is not very reliable. If

you want to stick with this format then you should modify the above

command to the following.

qmail-start ./Mailbox

Better is to try the newer Maildir format supported by qmail. In the

Maildir format, user mail is stored in their own home directories under a

special directory. This is what I have used here. You will have to create

a new directory under the users home directory. Use the included

maildirmake utility to do this.

/var/qmail/bin/maildirmake ~mayank/Maildir

This will create the necessary directory structure for user mayank to

receive mail under. Do this for all existing users. Also do the same in

/etc/skel so that a Maildir directory is created for each new user that is


/var/qmail/bin/maildirmake /etc/skel/Maildir

For more information read INSTALL.maildir in the qmail archive.

Now create /var/qmail/service/qmail/log/run with the following contents.


exec env - PATH="/usr/local/bin" \

setuidgid qmaill multilog t /var/log/qmail/qmail

This one goes into /var/qmail/service/smtpd/run


exec env - PATH="/usr/local/bin:/var/qmail/bin" \

tcpserver -v -x /etc/tcp.smtp.cdb -u 2045 -g 2062 0 25 \

qmail-smtpd 2>&1

Replace 2045 here with your qmaild user ID and 2062 with your qmail group


id -u qmaild - Gives you the qmaild user id.

id -g qmaild - Gives you the qmaild group id.

For SMTP you need to create a database of the clients allowed to send mail

through your server. You start out with a plain text file that contains a

list of the IP addresses that can relay mail through your server.

Create a file /etc/tcp.smtp with the following contents. Add additional IP

addresses if required. The first entry must definitely be in the file




The file will need to be compiled into the binary cdb format which allows

for faster lookup. This is done by the tcprules program which is part of

the ucspi-tcp suite.

tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp

Let's log SMTP too. This file goes in as /var/qmail/service/smtpd/log/run.


exec env - PATH="/usr/local/bin" \

setuidgid qmaill multilog t /var/log/qmail/smtpd