Jon Simpson

Exim 4 configuration problem on Debian Lenny

16 Feb 2009 — debian, exim4

While upgrading my servers to the latest release (lenny) of Debian Linux, I encountered a bug with the configuration that had not manifested itself with previous upgrades to exim. The package reported an error when trying to update:

Setting up exim4-config (4.69-9) ...
DEBCONFsomethingDEBCONF found in exim configuration. This is most probably
caused by you upgrading to exim4 4.67-3 or later without accepting the
suggested conffile changes.

I did reject its configuration suggestions, mainly because I have a customised set-up that allows the use of some flat files to configure mail forwarding for virtual domains. To actually get exim4 to work properly after encountering this, I used apt-get purge to remove the packages and configs for exim4, exim4-base and related packages, then reinstalled them fresh - starting afresh with my with modifications.

After a good amount of searching, I found that the best (and package maintaner recommended) way to modify the exim4 config is to use the macro mechanism, not directly editing the exim4.conf.template file as most guides for setting up virtual e-mail domains recommend, explained on the debian pkg-exim4-maintainers list. Keeping an exim4.conf.localmacros file containing the customisation is a much better solution, the contents of mine is:

MAIN_LOCAL_DOMAINS = @:localhost:dsearch;/etc/exim4/virtual

To use the flat file router, you also require the vdom_aliases block in your exim configuration somewhere, either in /etc/exim4/conf.d/router/ if you use the split-file configuration, or between 300 and 400 blocks in /etc/exim4/exim4.conf.template if you use a single file scheme.

#####################################################
### router/350_exim4-config_vdom_aliases
#####################################################
vdom_aliases:
  driver = redirect
  allow_defer
  allow_fail
  domains = dsearch;/etc/exim4/virtual
  data = ${expand:${lookup{$local_part}lsearch*@{/etc/exim4/virtual/$domain}}}
  retry_use_local_part
  pipe_transport = address_pipe
  file_transport = address_file
  no_more
#####################################################
### end router/350_exim4-config_vdom_aliases
#####################################################

The configuration above assumes you keep your virtual e-mail tables in /etc/exim4/virtual. I had a case where I had not configured this path correctly, and it caused mail not to be accepted (fairly logical), with the following error.

RCPT TO: example@example.com
451 Temporary local problem - please try later
QUIT

Getting to the bottom of these problems took an hour or two of searching, but they were the only real hitch in upgrading the server to the latest Debian, so I’m pretty pleased overall.


 Home