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

Allow DKIM key to be injected with Docker Secrets

Open valentinomariotto opened this issue 7 months ago • 0 comments

Hi, thank you for this great container, it's very useful.

I'd like to pass my DKIM key as a secret in docker-compose, but I can't because of lines 29 and 30 of the opendkim.conf.sh script:

# Checks
if [ ! -f "${DKIM_KEYFILE}" ]; then
    echo "dkim >> Error: DKIM_KEYFILE ${DKIM_KEYFILE} not found"
    # shutdown everything
    s6-svscanctl -t /etc/s6
    exit 128
else
    echo "dkim >> Setting mode and owner on $DKIM_KEYFILE"
    chown root:root ${DKIM_KEYFILE}
    chmod 400 ${DKIM_KEYFILE}
fi

I think it'd be best to make the chown and chmod optional. So that if the owner is alredy root and the file is already readonly, we can use the secrets construct. Thank you

valentinomariotto avatar Jul 09 '25 11:07 valentinomariotto