Linux Network Administratoramp;#039;s Guide (3rd Edition) [Electronic resources]

Tony Bautts, Terry Dawson, Gregor N. Purdy

نسخه متنی -صفحه : 121/ 109
نمايش فراداده

15.2. Cyrus IMAP

Another option IMAP administrators have is the product from CMU called Cyrus. It is similar to UW IMAP as far as general functionality goesfrom the user standpoint, there will be little difference. The majority of the differences come on the administrative side. This is also where its benefits can be seen.

15.2.1. Getting Cyrus IMAP

The Cyrus software can be obtained in a number of places, but the most reliable choice, with the latest source releases, will be the central CMU Cyrus distribution site, http://asg.web.cmu.edu/cyrus/download/. Here, both current and previous releases can be downloaded. The availability of previous releases could be an advantage for sites with polices against using the most recent versions of software.

To begin the installation of the Cyrus server, download and decompress the latest version. You will need to download both the IMAP and SASL packages.

SASL is the authentication mechanism used by Cyrus IMAP, and will need to be configured and installed first. It is easily built using the standard "configure-make" order.

vlager# cd cyrus-sasl-2.1.15 
vlager# ./configure 
loading cache ./config.cache
checking host system type... i686-pc-linux-gnu
.
creating saslauthd.h
Configuration Complete. Type 'make' to build.
vlager# make 
make  all-recursive
make[1]: Entering directory `/tmp/cyrus-sasl-2.1.15'

Assuming the compile is completed without failure and you've successfully executed the make install, you can now proceed to configuring and installing the Cyrus IMAP server itself.

After decompressing the Cyrus IMAP source, prepare the configuration using the following command:

vlager# ./configure --with-auth=unix

This will prepare Cyrus IMAP to use the Unix passwd/shadow files for user authentication. It is also possible to enable Kerberos for authentication at this point.

Next, you will need to create all of the dependency files, and then build and install the package:

vlager# make depend
. . . 
vlager# make all CFLAGS=-O
. . . 
vlager# make install 
. . .

With that successfully completed, your Cyrus IMAP server is now ready to be configured.

15.2.2. Configuring Cyrus IMAP

You will need to create a user for the Cyrus server to use. It should be something that you can easily relate to your Cyrus server, and it also needs to be a part of the mail group.

Once the user is created, you can begin configuring your Cyrus server. The /etc/imapd.conf file is the primary configuration file for the server. Verify that it looks something like the example below. You may need to add some of these lines.

configdirectory:        /var/imap
partition-default:      /var/spool/imap
sievedir:               /var/imap/sieve
# Don't use an everyday user as admin.
admins:                 cyrus root
hashimapspool:          yes
allowanonymouslogin:    no
allowplaintext:         no

15.2.3. Troubleshooting Cyrus IMAP

Building Cyrus IMAP can be somewhat tricky, as it tends to be pickier about files and locations. If the configure process is failing, take special note of what exactly is causing the failure. For example, when building Cyrus-SASL, if the build fails with an error complaining about undefined references in the berkeley_db section, it is likely that you do not have BerkeleyDB installed, or you installed it in a place where the configure script isn't looking. The path to the installed BerkeleyDB can be set at the command line when the configure script is run. This method of tracing the root of the error, and remedying it can solve many problems.

Another common problem when building Cyrus IMAP involves the location of a file called com_err.h. It is expected by Cyrus IMAP to be in the /usr/include directory. However, it often tends to be found in the /usr/include/et directory. Therefore, it will be necessary to copy this file to the /usr/include directory for the installation to proceed.