HUB
Sign inSign up
opendkim logo

webkutir/opendkim

By webkutir

•Updated 21 days ago

Docker Image for OpenDKIM 2.11.0 on Ubuntu 26.10. Signs and verifies DKIM.

Image
Security
0

343

webkutir/opendkim repository overview

OpenDKIM milter for Postfix. It signs mail from trusted clients and verifies signatures on mail from everyone else.

⁠Image

  • Base image: ubuntu:26.10
  • OpenDKIM 2.11.0, the version packaged in Ubuntu 26.10
  • Listens on inet:${DKIM_SERVICE_PORT}. This stack uses port 41001
  • Signatures use rsa-sha256, canonicalization relaxed/simple, and the From header is oversigned

⁠Behavior in this image

  • AuthservID is set to PF_HOSTNAME. OpenDMARC should use that same name so it trusts this DKIM result.
  • On every start, 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.
  • Mail from those trusted hosts is signed.
  • Mail that Postfix marks with milter_macro_daemon_name=ORIGINATING is signed. Set that on the submission services so authenticated users outside the trusted network are signed too.
  • Other mail is verified.
  • The included signing table signs *@webkutirmail.com with selector wkmail.
  • Private keys are read from /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.

⁠Required environment

VariablePurpose
DKIM_SERVICE_PORTTCP port OpenDKIM listens on
PF_HOSTNAMEPublic mail hostname, used as the auth server id
TRUSTED_CLIENTS_IPNetwork allowed to have its mail signed, in CIDR form. Example: 10.0.0.0/24

⁠Run

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

⁠Add a domain with register.sh

/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.

Tag summary
Recent tags
Content type
Image
Digest
sha256:7775a78d5…
Size
69.1 MB
Last updated
21 days ago
docker pull webkutir/opendkim:latest