Back to the main page

Upgrading a cmail installation

This page describes to process of upgrading a cmail installation.

Installation method

If you installed cmail from the source distribution as described in the step-by-step installation guide, the following sections will explain how to upgrade that installation to the newest version.

If you installed cmail via another method (e.g. a package manager), please refer to your specific methods instructions for upgrading.

1 Updating the local repository clone

Enter the directory you originally cloned the cmail repository into. Run

~# git pull origin master

to update your local copy.

2 Building and installing the new binaries

In the cmail directory, run

~# make
~# make install

to build updated binaries from the source and install them over the old binaries.

3 Restart the daemons

In order to activate the updated binaries, restart each service by executing

~# service cmail-smtpd restart
~# service cmail-popd restart
~# service cmail-dispatchd restart

Check the log files for any errors that may occur.

4 Upgrading the database

If in the previous step you have encountered the error message

The database schema is at another version than required for this build

you will need to upgrade your databases. To do so, for each database, open the database file with the sqlite3 utility and determine the schema version by running

SELECT value FROM meta WHERE key='schema_version';

and find a file named update-oldversiontonewversion.sql in the sql-update/ folder of the source directory. To apply this update, run

.read /path/to/sql-update/update-xtoy.sql

within the sqlite3 shell and watch the output.

4a Restarting the daemons

As in step 3, restart the daemons and watch the logs for proper operation.