Sign inSign up

oxmix/postfix

By oxmix

•Updated 7 days ago

Alpine with AMD64/ARM64, support: SPF, DKIM, DMARC

Image
0

1.1K

oxmix/postfix repository overview

⁠Generating DKIM keys

Generate a DKIM private key and the corresponding DNS TXT record for your domain.

⁠1. Generate the keys

Replace example.com with your actual domain name.

docker run --rm -it alpine:3.23 ash -c '
apk add --no-cache opendkim-utils

opendkim-genkey -b 2048 -d example.com -s mail -v

echo "===== PRIVATE KEY ====="
cat mail.private
echo "===== PUBLIC DNS RECORD ====="
cat mail.txt
'
⁠2. Add the keys to Docker Compose
services:
  postfix:
    image: oxmix/postfix
    ports:
      - "25:25"
    environment:
      DOMAIN: example.com
      DKIM_TXT: |
        mail._domainkey IN TXT "v=DKIM1; k=rsa; p=REPLACE_WITH_PUBLIC_KEY"
      DKIM_KEY: |
        -----BEGIN PRIVATE KEY-----
        REPLACE_WITH_PRIVATE_KEY_CONTENT
        -----END PRIVATE KEY-----
    restart: unless-stopped

Replace the placeholder values with the generated key contents. Keep the private key formatting and line breaks intact.

Important: The DKIM_KEY format shown above must match the format expected by this image. Verify whether the image expects a PKCS#1 RSA private key (BEGIN RSA PRIVATE KEY) or a PKCS#8 private key (BEGIN PRIVATE KEY) before deploying.

⁠3. Add the DKIM record to DNS

Wait for DNS propagation before testing email delivery.

⁠4. Start Postfix
docker compose up -d
docker compose logs -f postfix

Security: Never publish private key or commit it to a public repository. The private key must remain secret.

Tag summary

Content type

Image

Digest

sha256:af6df3f0b…

Size

9.3 MB

Last updated

7 days ago

docker pull oxmix/postfix