Installing Qmail

The qmail program is a secure, reliable, efficient simple message transfer agent. It is meant to be a replacement for the entire sendmail-binmail system that most UNIX hosts use. For more information, Please see the following links:

http://www.lifewithqmail.org
http://www.qmailinfo.org
http://www.goodcleanemail.com

First thing we want to do is install the port and then patch it. Here is the way we will do this:


# cd /usr/ports/mail/qmail
# make install

When it pops up the the options screen, Uncheck the box that says RCDLINK so nothing is checked and hit Tab and then go to OK.

Lets add some users/groups and also we can create the supervise directories.


# cd /downloads/qmailrocks
# chmod 755 users.sh
# ./users.sh

Now lets copy over the qmail source and get it ready to be patched 


# cd /downloads/qmailrocks
# tar zxvf qmail-1.03.tar.gz

We now need to go to Johns site which is at http://qmail.jms1.net/patches/combined-details.shtml    and get the "Stable" version unless you're feeling dangerous then you can get the Testing version but a testing version is almost like a Beta in my opinion. John wrote it I am sure it works but it may have some bugs in it. The first command is fetching the actual patch from Johns site. Replace VER with the version of the patch that you downloaded. Then we will want to apply the patch so run the following commands:


# fetch http://qmail.jms1.net/patches/qmail-1.03-jms1.VER.patch
# cd /downloads/qmailrocks/qmail-1.03
# patch < ../qmail-1.03-jms1.VER.patch

For instance if you downloaded Johns Patch named qmail-1.03-jms1.7.07.patch, you would apply it like so:


# patch < ../qmail-1.03-jms1.7.07.patch

You should get a nice output of something like so:


(Creating file strsalloc.c...)
Patching file strsalloc.c using Plan A...
Hunk #1 succeeded at 1.
Hmm... The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff -ruN qmail-1.03-factory/strsalloc.h qmail-1.03-6b/strsalloc.h
|--- qmail-1.03-factory/strsalloc.h 1969-12-31 19:00:00.000000000 -0500
|+++ qmail-1.03-6b/strsalloc.h 2005-05-23 15:13:58.000000000 -0400
--------------------------
(Creating file strsalloc.h...)
Patching file strsalloc.h using Plan A...
Hunk #1 succeeded at 1.
Hmm... The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff -ruN qmail-1.03-factory/tcp-env.c qmail-1.03-6b/tcp-env.c
|--- qmail-1.03-factory/tcp-env.c 1998-06-15 06:53:16.000000000 -0400
|+++ qmail-1.03-6b/tcp-env.c 2005-05-23 15:13:58.000000000 -0400
--------------------------
Patching file tcp-env.c using Plan A...
Hunk #1 succeeded at 10.
Hunk #2 succeeded at 35.
Hunk #3 succeeded at 76.
Hunk #4 succeeded at 102.
Hmm... The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff -ruN qmail-1.03-factory/timeoutconn.c qmail-1.03-6b/timeoutconn.c
|--- qmail-1.03-factory/timeoutconn.c 1998-06-15 06:53:16.000000000 -0400
|+++ qmail-1.03-6b/timeoutconn.c 2005-05-23 15:13:58.000000000 -0400
--------------------------
Patching file timeoutconn.c using Plan A...
Hunk #1 succeeded at 10.
Hunk #2 succeeded at 79.
done

If you see done at the end, you should be fine and you can continue on. If you don't. you did something wrong.

Now run the following commands:


# make man
# make setup check

Lets get qmail setup for your local hostname. If your local hostname is bsd.localhost, use the following:


# ./config-fast bsd.localhost

You will get a output saying it is going to add that hostname to specific qmail control files. If you would like more information as to what these specific files control, please take a look at http://www.lifewithqmail.org/lwq.html#config-files

We now want to clean up the qmail install like so:


# cd /usr/ports/mail/qmail
# make clean

At this point I would not recommend deleting any of the qmail files. They really don't take up a lot of room but if you ever delete anything by accident or need to rebuild you queue, you can stop qmail and then run make setup check and then start qmail again. This by any means won't fix everything but leaving the qmail files there won't hurt a bit.

One last thing to recommend is going into /var/qmail/control/locals and making sure that file is empty. If you need a good explanation as to why to do this, take a look at How to use rcpthosts and locals

We are now done getting qmail setup (for now)!

Installing UCSPI-TCP