## Download

Now is the good time to mention that you MUST read the contents of INSTALL after downloading and unpacking the source code. No exceptions. When downloading via CVS, the install file in the `courier` module is hidden in a subdirectory (it will be moved to `INSTALL` by `make dist`), so please read the online version. Other modules have `INSTALL.html` at the top level, which can be read with any browser.

Download the source code tarball from `http://www.courier-mta.org/download.php`. This download page also contains the latest releases of the individual Courier component packages: Courier-IMAP, SqWebMail, and maildrop. Ad

Additionally, more frequent, but less stable, builds are regularly uploaded to `ftp://courier.sourceforge.net/pub/courier/courier/`.

### Download via CVS

The following applies for the entire Courier source code distribution, and sub-modules (Courier-IMAP, sqwebmail, maildrop).

In order to build from the CVS repository, you must the following additional software installed:

1. `autoconf 2.53`.
2. `automake 1.6.3`.
3. `libtool 1.4.2`
4. `gettext 0.11.4`
5. `gmake`, of course.
6. sysconftool - this is an extra autoconf macro used by Courier's `configure.in`
7. The following tools that convert Docbook SGML to HTML and man page documentation: OpenJade, docbook DSSL stylesheets, and `sgml-common`, `docbook` 3.0 and 3.1 DTDs, and `docbook-utils`.

These additional dependencies are only required if building from CVS, and not the packaged tarballs.

The source code can be checked out with the following commands:

        CVSROOT=:pserver:anonymous@cvs.courier.sourceforge.net:/cvsroot/courier
        export CVSROOT
        cvs login

Press ENTER when asked for a password (blank password).

> `cvs -z3 checkout -r courier-latest courier` - get the entire Courier mail server source code, or:

> `cvs -z3 checkout -r courier-imap-latest courier-imap` - get just the standalone IMAP server source code, or:

> `cvs -z3 checkout -r sqwebmail-latest sqwebmail` - get just the standalone webmail server source code, or:

> `cvs -z3 checkout -r maildrop-latest maildrop` - get just the standalone version of Courier's mail filter's source code.

NOTE: Automatically-generated `configure` and `Makefile`, `libtool`, and `sysconftool` scripts are NOT stored in the repository, and you must build them yourself. Fortunately, it's very easy to do this. Simply run the following command after checking out any one of these modules:

        sh autobloat

The `autobloat` script automatically runs `automake`, `autoconf`, `libtool`, `sysconftool`, from the current directory.

NOTE: The "courier" module is the entire mail server. The other modules extract selected portions, with a different top-level makefile that builds a standalone package. You only need to obtain the `courier` module, to get the source code for Courier. See Introduction for more information.

NOTE: the `HEAD`s of each module contain the latest development versions, which may not be very stable. Use the tags specified above to obtain the latest "semi" stable release. Usually the "latest" tags will match the source code in the most recent tarball, but they may include some additional patches for the next release.

### Debian packages

Questions about the Debian port should be mailed to `<courier``@packages.debian.org>`.

### Building RPMs

You can build binary Courier RPMs directly from the tarball, using RPM version 4.0.2 or higher. For example:

    rpm -ta courier-0.45.4.tar.bz2

For RPM 4.1 and higher (Red Hat 8.0), use `rpmbuild` instead of `rpm`:

    rpmbuild -ta courier-0.45.4.tar.bz2

Because the RPMs can be built directly from the tarball, binary RPMs will not be distributed separately.

Note that Courier does not allow itself to be built as root. A single mistake -- especially when trying to build a system-level utility -- can have serious consequences. Therefore the configuration script won't let you. There's an undocumented flag to disable the check, for folks who don't make mistakes :-) See the FAQ for instructions on how to configure RPM to build packages as non-root.

Building the RPM packages yourself will also result in the packages being customized for your system. This procedure builds the following packages:

- `courier-0.45.4-1.%{_arch}.rpm` - the base mail server.
- `courier-smtpauth-0.45.4-1.%{_arch}.rpm` - install this package to enable authenticated ESMTP, in the ESMTP server.
- `courier-ldap-0.45.4-1.%{_arch}.rpm` - module to authenticate against an LDAP directory. Install this module if you would like to use an LDAP directory to authenticate and manage mail accounts. LDAP support requires the OpenLDAP library to be installed. If OpenLDAP development libraries are not installed, this package will be empty.
- `courier-mysql-0.45.4-1.%{_arch}.rpm` - module to authenticate using a MySQL database. Install this module if you would like to use a MySQL database to authenticate and manage mail accounts. If MySQL development libraries are not installed, this package will be empty.
- `courier-pgsql-0.45.4-1.%{_arch}.rpm` - module to authenticate using a PostgreSQL database. Install this module if you would like to use a PostgreSQL database to authenticate and manage mail accounts. If PostgreSQL development libraries are not installed, this package will be empty.
- `courier-fax-0.45.4--1.%{_arch}.rpm` - several supporting scripts for sending E-mails by fax.
- `courier-pop3d-0.45.4-1.%{_arch}.rpm` - the POP3 server.
- `courier-imapd-0.45.4-1.%{_arch}.rpm` - the IMAP server.
- `courier-webmail-0.45.4-1.%{_arch}.rpm` - the webmail server.
- `courier-webadmin-0.45.4-1.%{_arch}.rpm` - the web-based configuration tool.
- `courier-webadmin-0.45.4-1.%{_arch}.rpm` - the web-based administration tool (just the `cgi-bin` wrapper, actually, the remaining files are installed by other packages).
- `courier-maildrop-0.45.4-1.%{_arch}.rpm` - maildrop mail filter (required if you want to implement mail filtering).
- `courier-mlm-0.45.4-1.%{_arch}.rpm` - the couriermlm mailing list manager.
- `courier-sendmail-wrapper-0.45.4-1.%{_arch}.rpm` - install this package to create soft links from `/usr/bin/sendmail`, `/usr/lib/sendmail`, and several other popular places, to Courier's sendmail wrapper. This package will not be created on Red Hat 7.3 and later, which uses the Debian-derived alternatives mechanism. The alternatives mechanism will be incorporated into the main Courier package.
- `courier-maildrop-wrapper-0.45.4-1.%{_arch}.rpm` - install this package to create soft links in the `/usr/local/bin` subdirectory, for applications which expect to find `maildrop` in the `/usr/local/bin` directory. `maildrop` is also available as a standalone package, which normally installs in the `/usr/local/bin` subdirectory. Courier includes an integrated version of `maildrop`, and you can install this package to allow applications that are configured for the standalone `maildrop` version to use Courier's integrated version instead.

NOTE: these packages are built with certain directories in a non-default location. Specifically, the configuration files are installed in `/etc/courier`, the mail spool is installed in `/var/spool/courier`, and the manual pages are installed directly in `/usr/man`. Other configuration settings are left at their defaults, which means, for example, that the IMAP server is not compiled to include workarounds for bugs in several IMAP clients. If you need to change the defaults, you will have to build your own packages. These RPM packages are customized to work in my personal Linux distro (usually the latest version of Red Hat+patches), and these configuration settings may need to be adjusted for other distros. It's not that it's not possible to build a generic RPM, it's just that these RPM packages are built for my convenience's sake only.

NOTE: the first time the system boots after installing the Courier RPM, the system may pause for several minutes at the "Starting Courier" prompt. That's because the startup script automatically creates test SSL certificates the first time the script is executed (provided that SSL support is available). This can take as much as 5-6 minutes on a slow machine. Subsequent starts should take only a few seconds. Have patience. Also note that the main Courier RPM has the ESMTP server turned off. You must manually enable receiving mail via ESMTP by editing the `esmtpd` configuration file.

### RPM customization

If you want to customize your RPMs, you should extract the spec file from the tarball, and edit it yourself. However, there is a hook that can be used to pass additional flags to the configure script, from the RPM command line. Example:

    rpm -ta --define 'xflags --without-explicitsync --enable-https' \
       courier-0.45.4.tar.gz

You can use most of the `configure` script options, except for directory location options. See INSTALL for a list of options to the `configure` script.

PREV: Introduction | NEXT: Installation