No description
Find a file
2025-11-11 15:30:37 +01:00
assets new: "get tools.sh" 2024-12-17 11:29:13 +01:00
ex Squashed commit of the following: 2024-11-12 09:12:09 +01:00
exim@fc38fe88b9 sm: update to exim 4.99 2025-11-11 15:30:37 +01:00
system-integration new: add /opt/exim/lib to the mounted volumes 2024-11-12 14:19:02 +01:00
.dockerignore rework for bullseye and 4.95 2022-10-15 11:22:59 +02:00
.editorconfig Add .editorconfig 2017-12-07 22:34:31 +01:00
.gitignore git: ignore build artifact exim.oci 2025-09-08 14:06:08 +02:00
.gitmodules git: submodule url 2025-03-24 15:15:04 +01:00
compose.yaml Squashed commit of the following: 2024-11-12 09:12:09 +01:00
Dockerfile chg: cached builds 2025-04-14 22:44:16 +02:00
Makefile always pull a newer base image if available 2025-02-20 11:03:00 +01:00
README.md doc 2025-02-21 13:57:11 +01:00

Run Exim via Docker / Podman

Rationale

Exim has a versatile built time config. Depending on your target's operating system variant (distribution, version, …) dependency issues might arrise for custom builds.

Containerization provides a high isolation level between the target host and the application. Libraries inside the containerized application do not conflict with libraries of the host operating system.

Build the image

First we need the most important prerequisite: The source of the Exim version we are about to build. This is included as a sub-repo:

git submodule init exim
git submodule update exim

For building the image, either of

  • official Docker version
  • packaged Podman version as it comes with Debian 12 (Bookworm) can be used.

Then simply run

make CONTAINER=<engine>

where <engine> is either podman or docker.

This should produce a container image named "exim". A simple test can be conducted running make test.

Running the image

# set container to either podman or docker
$container run \
    --rm \
    -v /etc/exim:/etc/exim:ro \
    -v /var/log/exim:/var/log/exim \
    -v /var/spool/exim:/var/spool/exim \
    -v /var/lib/exim:/var/lib/exim \
    -p :25 \
    -p :587 \
    --name exim \
    exim: -bdf -q3m

If there are no options, exim -bV is started. If there are options, and the first one starts with a dash, the shell equivalent of exim "$@" is started. If the first option doesn't start with a dash, it is taken as a command.

Further commands can be run inside the container now. E.g.:

$container exec exim exiwhat

Install the Exim tools

$container run --rm exim 'get tools.sh' | (cd /usr/local/bin && sh)

Configuration

If you use a docker managed volume, the config volume will contain the default Exim configuration file. Feel free to edit it.

If you want to provide the /etc/exim config dir on an external volume, via a bind mount, you can first extract the default configuration:

$container run --rm exim cat /etc/exim/exim.conf

Open issues

  • Log rotation (issue #1)