docker-postfix icon indicating copy to clipboard operation
docker-postfix copied to clipboard

DKIM files (KeyTable, SigningTable, TrustedHosts) keep being overridden?

Open conficient opened this issue 6 months ago • 0 comments

Trying to get postfix working with DKIM for multiple domains. I only need to send out emails, so no inbound requirements.

When I run the container, it seems the KeyTable, SigningTable and TrustedHosts files are being overwritten?

I've set up /opt/postfix/dkim/ with completed versions of these files for the domains I need to handle, and created the keys in /opt/postfix/dkim/keys/ with a folder for each domain; e.g. /opt/postfix/dkim/keys/example.com/default.private

The docker-compose.yml is as follows:

version: '3'

services:
  postfix:
    image: boky/postfix
    restart: unless-stopped
    container_name: postfix
    ports:
      - "587:587"
    environment:
      - ALLOW_EMPTY_SENDER_DOMAINS=true
      - DKIM_ENABLE=true
      - [email protected]
    volumes:
      - /opt/postfix/dkim/keys:/etc/opendkim/keys
      - /opt/postfix/dkim/KeyTable:/etc/opendkim/KeyTable
      - /opt/postfix/dkim/SigningTable:/etc/opendkim/SigningTable
      - /opt/postfix/dkim/TrustedHosts:/etc/opendkim/TrustedHosts

If I append :ro to the volumes to stop it overwriting, I get an error

Suggestions welcomed!

conficient avatar Jun 09 '25 12:06 conficient