This site is now 100% read-only, and retired.

Upgrading from Woody to Sarge: Part 3 - Exim4

Posted by Steve on Fri 25 Feb 2005 at 22:05

Upgrading from Woody to Sarge gives you a lot of new packages, and large upgrades in packages you may be familiar with. One of the large upgrades that you might be specifically interested is Exim4.

Exim is the default mail server for Debian systems (it was chosen at a time when it offered more flexability than anything else avaiable), although you are free to use Sendmail, Postfix or anything else you like if you have strong views.

Although you can continue using an existing exim3 installation this is no longer supported by the authors of the software, and upgrading will give you significant improvements in the handling of SPAM mail.

Upgrading from Exim3 to Exim4

Once you have upgraded to Sarge, as described in the previous simple article you can upgrade to Exim4 fairly easily.

First of all you should backup your existing configuration files, which will be contained in the directory /etc/exim/:

cp -R /etc/exim /etc/exim.orig

This will give you a safe copy in the event you need to move back to the older version.

Once ready for the upgrade you will discover that there are several different version of exim4 available. Which one you choose will depend upon your needs.

To see all the available options you can run the following command:

skx@lappy:~$ apt-cache search ^exim4
exim4 - metapackage to ease exim MTA (v4) installation
exim4-base - support files for all exim MTA (v4) packages
exim4-config - configuration for the exim MTA (v4)
exim4-daemon-heavy - exim MTA (v4) daemon with extended features, including exiscan-acl
exim4-daemon-light - lightweight exim MTA (v4) daemon
exim4-doc-html - documentation for Exim v4 in html format
exim4-doc-info - documentation for Exim v4 in info format

(Here we use the ^ symbol to limit our search to packages which start with the word exim4)

The two main choices are:

  • exim4-daemon-heavy
    • A package with lots of extra options, including the exiscan-acl support.
  • exim4-daemon-light
    • A more minimalist installation of exim4 without extra options enabled.

If you know you wish to use LDAP, have database support, make extensive spam tests at SMTP time, or have other complex features available then you should install the heavy version of the package.

Alternatively if you're just planning on receiving mail for a small number of users for a single domain, or send minimal outgoing messages from cron, etc, you only need to install the light version.

Once you've made your decision install the relevent package. This will remove the version of exim3 that you have running (but leave the old configuration file in place), so until the setup has been complete you'll be not be able to recieve new mail. (You shouldn't lose mail, if your mailserver is down and not accepting new connections mail servers attempting to deliver to you will queue the mail for some time, don't panic if it takes you an hour or more to setup the new server).

Install your chosen package via apt-get as usual:

root@sarge:~# apt-get install exim4-daemon-heavy
Reading Package Lists... Done
Building Dependency Tree... Done
The following extra packages will be installed:
  exim4-base exim4-config libmysqlclient10 libperl5.8 libpq3 mysql-common
Suggested packages:
  eximon4 exim4-doc-html exim4-doc-info postgresql-doc postgresql-client
The following packages will be REMOVED:
The following NEW packages will be installed:
  exim4-base exim4-config exim4-daemon-heavy libmysqlclient10 libperl5.8
  libpq3 mysql-common
0 upgraded, 7 newly installed, 1 to remove and 0 not upgraded.
Need to get 2314kB of archives.
After unpacking 3617kB of additional disk space will be used.
Do you want to continue? [Y/n] 

Once the packages have been downloaded and installed you will be presented with the debconf configuration screen.

As a major change from exim3 there are two ways to handle the configuration of exim4:

  • Have one large, monolithic, configuration file.
  • Break the configuration of the package up into lots of little files.

Using lots of small files makes it easier to push updates to multiple machines, or make minimal changes that are easy to adapt to package upgrades. It also allows other packages to install updates, so for example a mailing list manager might install its own small configuration snippet as a new file.

The other approach of using a single large file for all the configuration settings is the method that exim3 used, and the choice you're offered by default.

Personally I am not scared of a large file, and find it easier to make backups and changes when everything is in one place - so I will ask for all files to be joined together.

Once the configuration file splitting has been addressed there will be several more screens of questions to answer. The later questions will depend on how you answer the initial questions.

For me the most obvious first question was the "type" of mail server I was installing, as the machine I was upgrading was handling mail for a number of domains I said it was sending and recieving mail directly via SMTP, and the questions were roughly answered as follows:

  • Mail is sent and received using SMTP
  • You can enter the main domain name as the hostname
  • The domains we handle mail for seperated by ":" characters.
  • Any additional domains we handle.
  • Listen for incoming connections on the external IP address and also the loop back address of

For me that was the minor configuration upgrade handled!

The answers to the debconf questions are stored in the file /etc/exim4/update-exim4.conf.conf, and can be reentered by running:

dpkg-reconfigure exim4-config

(Alternatively you can edit the file manually then update the settings used by your exim4 installation by executing update-exim4.conf)

Lots of additional documentation is available once the package is installed, the main file you should read is /usr/share/doc/exim4-base/README.Debian.gz. This shows you how the configuration files are generated and where to look to make changes, it also discusses the upgrade strategy.

Once the package has been configured and before making any changes you should test that the server works as expected - that you can receive new mail!

Only after verifying that basic operation is complete should you start revelling in the new features available.

As a cleanup you can remove all the obsolete configuration files that the old exim package used by running:

dpkg --purge exim
rm -rf /etc/exim.orig

That should conclude your upgrade.