Mail Server Mini-Howto

Chapter 1


Previous

 

Next

Installing Qmail

In this section, we will go through the steps of setting up an SMTP server with Qmail. There are other popular packages (namely sendmail) available, but I think Qmail is easier to configure.

  1. Getting Qmail
  2. Installing Qmail
  3. Qmail Control Files

 

Getting Qmail

Go to the Qmail Homepage (http://www.qmail.org) and find out what the latest version of Qmail is. As of this writing, the latest is Qmail 1.0.3.

You have two choices here, you can either download the Qmail source files and compile it yourself, or you can download an SRPM and have it built for you.

If you are running using RedHat, the easier thing to do would be to download the SRPM, that's what I did. If you prefer, download the Qmail source and build/install it yourself. There is plenty of good documentation (linked from the Qmail Homepage) on how to do it.

I downloaded David Summer's qmail-1.03-6.src.rpm from ftp://ftp.engr.uark.edu/pub/qmail.

 

Installing Qmail

For detailed installation instructions check out Keith Burdis' Installation at http://yoda.cs.ru.ac.za/~keith/redhat.html. I'll summarize them for you:

$ rpm -i qmail-1.03-6.src.rpm
$ rpm -bb /usr/src/redhat/SPECS/qmail-1.03-6.spec

This creates three Qmail RPMs in /usr/src/redhat/RPMS/i386. The only one you are interested in is qmail-1.03-6.i386.rpm, you don't need the other two. Now let's install it:

$ rpm -U /usr/src/redhat/RPMS/i386/qmail-1.03-6.i386.rpm

Now clean up the stuff mess created during the BUILD process. Don't cut and paste this section blindly! Look at what I'm deleting before you do it:

$ rm -rf /usr/src/redhat/SPECS/qmail*
$ rm -rf /usr/src/redhat/SOURCE/qmail*
$ rm -rf /usr/src/redhat/BUILD/qmail*

At this point, you should have Qmail installed. Now you must tell Qmail about your server configuration.

 

Qmail Control Files

The first thing to do is tell Qmail about your server. First, let's assume your domain is foo.bar. There are a bunch of files in /etc/qmail that you will have to edit:

/etc/qmail/control/me

This file contains the name of the fully qualified name of your server. I want my server to be known as mail.foo.bar, so I have this file contains the line:

mail.foo.bar

/etc/qmail/control/defaultdomain

This file contains your default domain name, Qmail will add this default domain to hostnames with out dots. So the email address joe@mail becomes joe@mail.foo.bar. For more information, read the qmail-inject man page. Since our domain is foo.bar, this file should contain the line:

foo.bar

/etc/qmail/control/defaulthost

This file contains the default host name, Qmail adds this to email addresses without hostnames. Normally, you would probably want to set this to your domain name - so the email address joe becomes joe@foo.bar. Since we want this, the file should contain the line:

foo.bar

/etc/qmail/control/locals

This file contains the list of domains that Qmail will receive mail for. For example, to receive and deliver messages locally for email addresses like joe@foo.bar or joe@mail.foo.bar, this file should contain the lines:

foo.bar
mail.foo.bar

For more information on these control files, check the Qmail homepage or read the qmail-control man page by typing:

$ man 5 qmail-control

In the next section, we will look at configuring Qmail to run as we'd like.

 

Previous

Next

Web Database Mini-Howto by Ying Zhang (ying @ zippydesign dot com)