Docker Image for OpenDKIM 2.11.0 on Ubuntu 26.10. Signs and verifies DKIM.
343
OpenDKIM milter for Postfix. It signs mail from trusted clients and verifies signatures on mail from everyone else.
ubuntu:26.10inet:${DKIM_SERVICE_PORT}. This stack uses port 41001rsa-sha256, canonicalization relaxed/simple, and the From header is oversignedAuthservID is set to PF_HOSTNAME. OpenDMARC should use that same name so it trusts this DKIM result.trusted.hosts is rewritten from TRUSTED_CLIENTS_IP. 127.0.0.1 and localhost are always trusted. A hand-edited trusted.hosts is replaced at the next start.milter_macro_daemon_name=ORIGINATING is signed. Set that on the submission services so authenticated users outside the trusted network are signed too.*@webkutirmail.com with selector wkmail./etc/opendkim/keys. Mount /etc/opendkim so keys and table changes survive a new container. Each *.private file is mode 600 and owned by opendkim.The container needs DNS that can look up DKIM records when it verifies mail.
| Variable | Purpose |
|---|---|
DKIM_SERVICE_PORT | TCP port OpenDKIM listens on |
PF_HOSTNAME | Public mail hostname, used as the auth server id |
TRUSTED_CLIENTS_IP | Network allowed to have its mail signed, in CIDR form. Example: 10.0.0.0/24 |
docker run -d --name opendkim \
-p 41001:41001 \
-e DKIM_SERVICE_PORT=41001 \
-e PF_HOSTNAME=mail.example.com \
-e TRUSTED_CLIENTS_IP=10.0.0.0/24 \
-v /path/to/opendkim:/etc/opendkim \
webkutir/opendkim:2.11.0
Point Postfix at that port, before the DMARC milter:
smtpd_milters = inet:opendkim:41001, inet:opendmarc:10020
/register.sh creates a 2048-bit key for selector wkmail, then appends one line to signing.table and one line to key.table. Run it once per domain, inside the running container. The volume on /etc/opendkim keeps the key and the new table lines.
docker exec opendkim /register.sh example.com
The command prints wkmail.txt. Publish that text as a TXT record at wkmail._domainkey.example.com. Leave wkmail.private on the server.
OpenDKIM reads the tables at startup, so reload it after registering a domain:
docker exec opendkim service opendkim restart
Running the script again for the same domain replaces the old key and the old table lines. The command prints only the new public key. Publish that TXT record, then reload OpenDKIM.
docker pull webkutir/opendkim:latest