Git Product home page Git Product logo

opendkim-docker-image's Introduction

OpenDKIM Docker image

Release CI Docker Hub Uses

Docker Hub | GitHub Container Registry | Quay.io

Changelog

Supported tags and respective Dockerfile links

What is OpenDKIM?

OpenDKIM is an open source implementation of the DKIM (Domain Keys Identified Mail) sender authentication system proposed by the E-mail Signing Technology Group (ESTG), now standardized by the IETF (RFC6376). It also includes implementations of the RFC5617, Vouch By Reference (VBR, RFC5518), proposed standard and the experimental Authorized Third Party Signatures protocol (ATPS, RFC6541).

The OpenDKIM Docker image consists of a library that implements the DKIM service and a milter-based filter application that can plug in to any milter-aware MTA to provide that service to sufficiently recent sendmail MTAs and other MTAs that support the milter protocol.

OpenDKIM is a unit of The Trusted Domain Project.

www.opendkim.org
github.com/trusteddomainproject/OpenDKIM

OpenDKIM Logo

How to use this image

To run OpenDKIM milter application just start the container:

docker run -d -p 8891:8891 instrumentisto/opendkim

Configuration

To configure OpenDKIM you may use one of the following ways (but not both at the same time):

  1. Drop-in files.
    Put your configuration files (must end with .conf) into /etc/opendkim/conf.d/ directory. These files will be applied to default OpenDKIM configuration when container starts.

    docker run -d -p 8891:8891 \
               -v /my/custom.conf:/etc/opendkim/conf.d/10-custom.conf:ro \
           instrumentisto/opendkim

    This way is convenient if you need only few changes to default configuration, or you want to keep different parts of configuration in different files.

  2. Specify whole configuration.
    Put your configuration file opendkim.conf into /etc/opendkim/ directory, so fully replace the default configuration file provided by image.

    docker run -d -p 8891:8891 \
               -v /my/custom.conf:/etc/opendkim/opendkim.conf:ro \
           instrumentisto/opendkim

    This way is convenient when it's easier to specify the whole configuration at once, rather than reconfigure default options.

Default configuration

By default, the OpenDKIM milter application inside this Docker image is configured to perform only signatures verification.

To see whole default OpenDKIM configuration of this Docker image just run:

docker run --rm instrumentisto/opendkim cat /etc/opendkim/opendkim.conf

Keys generation

This Docker image also contains OpenDKIM tools that may be used for DKIM keys generation. For example:

docker run --rm -v /my/keys:/tmp -w /tmp --entrypoint opendkim-genkey \
       instrumentisto/opendkim \
           --subdomains \
           --domain=example.com \
           --selector=default

Important tips

As far as OpenDKIM writes its logs only to syslog, the syslogd process runs inside container as second side-process and is supervised with s6 supervisor provided by s6-overlay project.

Logs

The syslogd process of this image is configured to write everything to /dev/stdout.

To change this behaviour just mount your own /etc/syslog.conf file with desired log rules.

s6-overlay

This image contains s6-overlay inside. So you may use all the features it provides if you need to.

Image tags

<X>

Latest tag of the latest major X OpenDKIM version.

<X.Y>

Latest tag of the latest minor X.Y OpenDKIM version.

<X.Y.Z>

Latest tag of the concrete X.Y.Z OpenDKIM version.

<X.Y.Z>-r<N>

Concrete N image revision tag of the concrete X.Y.Z OpenDKIM version.

Once built, it's never updated.

alpine

This image is based on the popular Alpine Linux project, available in the alpine official image. Alpine Linux is much smaller than most distribution base images (~5MB), and thus leads to much slimmer images in general.

This variant is highly recommended when final image size being as small as possible is desired. The main caveat to note is that it does use musl libc instead of glibc and friends, so certain software might run into issues depending on the depth of their libc requirements. However, most software doesn't have an issue with this, so this variant is usually a very safe choice. See this Hacker News comment thread for more discussion of the issues that might arise and some pro/con comparisons of using Alpine-based images.

License

OpenDKIM is licensed under BSD license.

As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).

As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.

The sources for producing instrumentisto/opendkim Docker images are licensed under Blue Oak Model License 1.0.0.

Issues

We can't notice comments in the DockerHub (or other container registries) so don't use them for reporting issue or asking question.

If you have any problems with or questions about this image, please contact us through a GitHub issue.

opendkim-docker-image's People

Contributors

dependabot[bot] avatar quite4work2 avatar tyranron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

opendkim-docker-image's Issues

OpenDKIM Database support

DKIM optionally supports databases via opendbx.

Would be willing to contribute SQL support if it would be merged.

My current Dockerfile for DKIM
FROM alpine:3.14

ENV DKIM_SOCKET="inet:3000"

EXPOSE 3000

# Install dependencies
RUN apk add --no-cache \
    gettext \
    libmilter \
    mariadb-dev \
    s6-overlay \
  && apk add --no-cache --virtual .tool-deps \
    coreutils autoconf automake g++ libtool make \
     \
  && apk add --no-cache --virtual .build-deps \
    db-dev \
    libmilter-dev \
    openssl-dev \
    readline-dev

# Copy pre-downloaded packages
COPY packages /opt/packages/

# Compile and install opendbx
RUN cd /opt/packages \
  && tar xzf opendbx-1.4.6.tar.gz \
  && cp config.guess opendbx-1.4.6 \
  && cp config.sub opendbx-1.4.6 \
  && cd opendbx-1.4.6/ \
  && CPPFLAGS="-I/usr/include/mysql" ./configure --with-backends="mysql" \
  && make install

# Compile and install OpenDKIM
# The apk version doesn't have important flags we need
RUN cd /opt/packages \
  && tar xzf 2.11.0-Beta2.tar.gz \
  && cd OpenDKIM-2.11.0-Beta2 \
  && autoreconf -vif \
  && CPPFLAGS="-I/usr/include/openssl" ./configure \
    --sysconfdir=/etc/opendkim \
    --with-odbx \
    --with-openssl \
    --with-sql-backend \
    --docdir=/tmp/opendkim/doc \
    --htmldir=/tmp/opendkim/html \
    --infodir=/tmp/opendkim/info \
    --mandir=/tmp/opendkim/man \
  && make \
  && addgroup -S -g 91 opendkim \
  && adduser \
    -S -u 90 -D \
    -s /sbin/nologin \
    -H -h /run/opendkim \
    -G opendkim -g opendkim \
    opendkim \
  && addgroup opendkim mail \
  && make install \
  && install -d -o opendkim -g opendkim /run/opendkim/ \
  && install -d /etc/opendkim/conf.d/ \
  && install -d /usr/share/licenses/opendkim/ \
  && mv /tmp/opendkim/doc/LICENSE* /usr/share/licenses/opendkim/ \
    \
  && apk del .tool-deps .build-deps \
  && rm -rf /var/cache/apk/* /tmp/*

RUN mkdir -p /etc/opendkim/

# Copy files
COPY rootfs /

ENTRYPOINT ["/init"]

CMD ["opendkim", "-f"]

Postfix can't connect to opendkim

This is a question more than an issue, but i've just been looking at this same error for too long :) Postfix refuses to connect to opendkim fatal: host/service opendkim/8891 not found: Name or service not known. Both services are in the same docker network. Hence, I can go into the container that has postfix installed and do:

root@mail:/# telnet opendkim 8891
Trying 192.168.112.4...
Connected to opendkim.
Escape character is '^]'.

The only thing i changed in my conf file is the mode:

UserID                  opendkim:opendkim
BaseDirectory           /run/opendkim
Socket                  inet:8891

Syslog                  Yes
SyslogSuccess           Yes

Mode                    v
Canonicalization        relaxed/simple


#
# /etc/opendkim/conf.d/10-custom.conf
#
Mode  sv

Docker-compose.yml

  opendkim:
    image: instrumentisto/opendkim:alpine
    container_name: opendkim
    environment:
      - S6_KILL_GRACETIME:1000
    volumes:
      - /opt/opendkim/default.private:/etc/dkimkeys/dkim.key:ro
      - ./opendkim/10-mode.conf:/etc/opendkim/conf.d/10-mode.conf:ro
      - /etc/localtime:/etc/localtime:ro

OpenDKIM is up and running (no errors) and i've already generated my keys and linked them.

I'm all out of ideas. Any help would be greatly appreciated. Thanks!

/sbin/syslogd: No such file or directory

The command exec /sbin/syslogd -n is not working for me.
I have to do cp /usr/sbin/syslogd /sbin/syslogd inside the container to see logs.

Did the path change?

opendkim-genkey fails following instructions in README

I've just installed a container based on instrumentisto/opendkim:alpine (Alpine 3.12) and opendkim-genkey failed with the following message.

opendkim-genkey: generating private key
opendkim-genkey: openssl exited with status %d

It happens that opendkim-genkey requires openssl, which is not installed. In another machine I had an instance of opendkim:alpine based on Alpine 3.10 where openssl was a softlink to libressl (I can't recall if it was modified in the container or not)

Please either update that in the image, or mention it in https://github.com/instrumentisto/opendkim-docker-image#keys-generation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.