|
|
3. Getting and installing the softwareMost of the software is included in your Linux distribution. I. e. SuSE is shipping Cyrus as far as I know since 7.1. Since SuSE 8.1, cyrus-imap 2.1 and sasl2 is included, and works. It is still recommended to compile Cyrus by yourself. SuSE does not ship a MySQL enabled Postfix.
3.1. Getting and installing MySQL3.1.1. DownloadOrigin-Site: http://www.mysql.com/downloads/ 3.1.2. Building and installing
To improve security, add a mysql-user on your system i.e. »mysql«, then
If you want to start MySQL automatically at boottime, copy /usr/local/mysql/share/mysql/mysql.server to /etc/init.d/ for SuSE, for Redhat it is /etc/rc.d/init.d instead of /etc/init.d/. Further you need to add symbolic links to /etc/init.d/rc3.d for SuSE and /etc/rc.d/rc3.d for Redhat. The following example is for SuSE Linux and should be easily changed for Redhat and other Linux distributions and commercial Unix systems.
3.2. Getting and installing Berkeley DBThe Berkeley DB is a requirement for building Cyrus-SASL and Cyrus-IMAP. Some Systems comes with recent versions but without the header files installed. Please see your distributors CD/DVD to see if you can install the header files from a package. Usually this package is called bdb-devel. The version that comes with GNU/Debian Linux is out of date, you will need to compile the most recent version instead. If you already installed Berkeley DB on your Debian Box, please uninstall it to prevent conflicts. It is also very important, that Cyrus-SASL and Cyrus-IMAP is compiled with the same version of Berkeley DB or else you can run into problems.
3.2.1. Download Berkeley DBOrigin-Site: http://www.sleepycat.com/update/snapshot/db-4.0.14.tar.gz 3.3. Getting and installing OpenSSL3.3.1. Download OpenSSLOrigin-Site http://www.openssl.org 3.3.2. Building and installing
3.4. Getting and installing Cyrus SASL and IMAPBuilding Cyrus SASL and IMAP from source is not a easy task. There are some prerequisites to be fulfilled, and lots of difficult authentication related stuff to be considered. 3.4.1. Download Cyrus SASL and Cyrus IMAPOrigin-Site: ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-2.1.18.tar.gz Origin-Site: ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-imapd-2.2.3.tar.gz 3.4.2. Create the cyrus userOn most systems there is no cyrus user and mailgroup by default. Check for a free UID, usually daemons are running with UIDs less that 100. As example I am using UID 96 which is what SuSE has in the default /etc/passwd.
3.4.3. Building and installing Cyrus SASL
The SASL library is installed in /usr/local/lib/sasl2 but some programs are expecting SASL in /usr/lib/sasl2. So it is a good idea to create a symbolic link: ln -s /usr/local/lib/sasl2 /usr/lib/sasl2. 3.4.4. Building Cyrus-IMAP
3.4.5. Automatic startup scriptIf you wish to start the Cyrus IMAP daemon automatically after booting, you need a startup script. Place the following script in /etc/init.d/. For Redhat, it is /etc/rc.d/init.d instead of /etc/init.d/.
If I get the time, I will provide a more sophisticated script, but this script works. Now create the Symlinks in the runlevel directory (SuSE):
For Redhat:
3.4.6. Update Cyrus IMAPdThis section describes HOWTO update the IMAPd from version 2.1.x to 2.2.x
Cyrus changed the format of the dbd databases used for internal storage of mailboxlist flags etc. A convert script comes with the distribution. The most important database is /var/imap/mailboxes.db. Without that database cyrus-imapd will NOT run. This requires a backup. Lets do a dump and a backup of the database.
Convert the /var/imap/mailboxes.db
Convert all the »seen« databases:
Converting the sieve scripts
3.5. Getting and installing Postfix3.5.1. DownloadOrigin-Site: http://www.postfix.org/ftp-sites.html 3.5.2. Creating a User-ID (UID) and Group-ID (GID) for postfixBefore you build and install postfix, be sure to create a »postfix« and a »postdrop« user and group if they do not exist on the system. First check for the groups. You can check this by grep postfix /etc/group and grep maildrop /etc/group If there are no such groups and users, you just create them. Search for a free numeric UID and GID. In the following example I will use UID and GID 33333 for Postfix and 33335 for the maildrop UID and GID. These ID's correspond to other documents.
3.5.3. Building and installingThe following section shows what you have to do if you installed MySQL from source as described above. If you installed MySQL from a binary package such as rpm or deb, then you have to change the include and library-flags to -I/usr/include/mysql and -L/usr/lib/mysql.
During make install a few question are asked. Just pressing Enter should match your needs. For Redhat users it could be useful to enter /usr/local/share/man Now you need to create some symbolic links to start Postfix automatically on system startup. The sample is for SuSE Linux, please consult your vendors manual for other distributions.
3.6. Getting and installing PAMPAM is installed by default on almost all Linux distributions. I am not describing how to compile PAM by yourself, because it could break your system. Instead, I will describe how to install the package.
Users of a RPM based distribution can issue the following command:
Debian users can install the devel package with the following command:
3.7. Getting and installing pam_mysql3.7.1. DownloadOrigin-Site: http://sourceforge.net/projects/pam-mysql/ 3.7.2. Installing
If you have compiled mysql by yourself, check the Makefile and enter the correct path to your mysql libs and add the compiler flag CFLAGS -I/path/to/mysql/include.
After customizing that file you an go ahead with the pam_mysql compile.
3.8. Getting and installing Web-cyradm3.8.1. DownloadOrigin-Site: http://www.web-cyradm.org 3.8.2. Installing
After unpacking web-cyradm, move it to a place in your webserver's documentroot. Thats all. Now you need to configure the whole bunch of software. Web-cyradm 0.5.4 is considered stable, and was released on 2003-12-05 Since web-cyradm uses PEAR for its database abstraction layer, you also need a recent copy of PEAR. This is included in recent PHP Versions. I strongly suggest to update PHP to 4.3.4, because a lot of important bugs have been fixed. A frequent mistake is to forget to touch the logfile and change the owner to the Apache UID. This is usually »nobody« or »wwwrun«. 3.8.3. Create the databases and tablesNow we need to create the database and tables for Postfix and Web-cyradm and add a user to the database. Web-cyradm comes with several MySQL scripts: insertuser_mysql.sql and create_mysql.sql. The first inserts the Database user to the database »mysql« and creates the database »mail«. The second creates the required tables and populates the database with an initial admin-user and the cyrus user. The other scripts are used for incremental upgrading from older releases. The password for the database user »mail« in this example is »secret«. Please insert whatever user and password you like. The username for the initial superuser is »admin« with the password »test«.
After customizing the username and password, apply the scripts:
3.8.4. Upgrading from 0.5.3 to 0.5.4In version 0.5.4 there is a small database enhancement. You can upgrade your database by issuing the MySQL script that comes with the distribution.
Since Version 0.5.3 web-cyradm has full support for DES crypted passwords. You can use the php-script migrate.php to convert the users passwords from plain text to unix compatible crypt (DES).
|

