Run Mailarchiva, the email archiving, e-discovery, compliance and forensics platform that helps to retain, organize and mine email data in Docker!
The existing projects, which try to run Mailarchiva as a Docker container, are outdated and not working anymore. I also disliked that they all tried to mimic the traditional on premise installation which is not necessary for a Tomcat application.
That's why I created this project.
- A Unix-like operating system: macOS, Linux, BSD.
git
should be installed (recommended v2.36.1 or higher)- Docker >= 27.4.0
-
Clone the repository
git clone https://github.com/tgoetten/mailarchiva-docker.git
-
Download latest Mailarchiva WAR file from https://stimulussoft.com/downloads and save it in
files/
wget https://stimulussoft.b-cdn.net/mailarchiva_v8.12.16.war -P files # for (old) Mailarchiva v8 wget https://stimulussoft.b-cdn.net/mailarchiva-9.0.36.war -P files/
-
Create a copy of the .env file and adjust it to your needs.
cp env.sample .env
-
(optional) Adapt ``docker-compose.yaml if needed
-
Start
docker-compose up
Before you perform the update steps above it is highly recommended to first create a backup.
-
Download latest Mailarchiva WAR file from https://stimulussoft.com/downloads and save it in
files/
wget wget https://stimulussoft.b-cdn.net/mailarchiva-9.0.36.war -P files
-
Update
Dockerfile
to use the new .war file when (re-) building the image. To do this, just update the ENV variable with the new .war filenameENV MAILARCHIVA_WAR=mailarchiva-9.0.36.war \ ...
-
Build image
DOCKER_BUILDKIT=1 docker build -t mailarchiva .
-
Stop and Re-Start the Container
docker-compose stop && docker-compose up -d
Login to Mailarchiva and make sure the version has changed.
Upgrading from version 8 to version 9 is done by either updating or replacing the Dockerfile and then build a new image same as done through the update step.
Mailarchiva will frequently write temporary files that in a NAS environment can prevent the disks from spinning down even if there is no activity on the mail servers.
In particular, JDK jstat
will write to /tmp/hsperfdata_root/1
and Mailalchiva will use /etc/ROOT/performance.stat
to display /status.do?page=chart
.
To prevent this, in docker-compose.yaml, mount two tmpfs volumes.
services:
mailarchiva:
tmpfs:
- /tmp/mailarchiva
- /tmp/hsperfdata_root
A singular file can not be mounted to tmpfs. Luckily, Mailarchiva will follow a symlink, but we need to create it in the local etc
storage.
cd etc/ROOT
ln -s performance.stat /tmp/mailarchiva/performance.stat
- Automate Download of Mailarchiva WAR file
-
Move from debian image to something smaller (less bloat, quicker build) -
Add instructions to update Mailarchiva to a newer version - Add support for SSL Certificate using Traefik