mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2024-01-19 02:48:50 +00:00
chore: Housekeeping on the 'open-dkim' script (#2267)
This commit is contained in:
parent
ed562a7057
commit
d9e8accf5f
2
Makefile
2
Makefile
|
@ -4,8 +4,6 @@ NAME ?= mailserver-testing:ci
|
|||
VCS_REF = $(shell git rev-parse --short HEAD)
|
||||
VCS_VER = $(shell git describe --tags --contains --always)
|
||||
|
||||
export CDIR = $(shell pwd)
|
||||
|
||||
# -----------------------------------------------
|
||||
# --- Generic Build Targets ---------------------
|
||||
# -----------------------------------------------
|
||||
|
|
|
@ -139,24 +139,24 @@ then
|
|||
exit 0
|
||||
fi
|
||||
|
||||
while read -r DOMAINNAME
|
||||
while read -r DKIM_DOMAIN
|
||||
do
|
||||
mkdir -p "/tmp/docker-mailserver/opendkim/keys/${DOMAINNAME}"
|
||||
mkdir -p "/tmp/docker-mailserver/opendkim/keys/${DKIM_DOMAIN}"
|
||||
|
||||
if [[ ! -f "/tmp/docker-mailserver/opendkim/keys/${DOMAINNAME}/${SELECTOR}.private" ]]
|
||||
if [[ ! -f "/tmp/docker-mailserver/opendkim/keys/${DKIM_DOMAIN}/${SELECTOR}.private" ]]
|
||||
then
|
||||
echo "Creating DKIM private key /tmp/docker-mailserver/opendkim/keys/${DOMAINNAME}/${SELECTOR}.private"
|
||||
echo "Creating DKIM private key /tmp/docker-mailserver/opendkim/keys/${DKIM_DOMAIN}/${SELECTOR}.private"
|
||||
|
||||
opendkim-genkey \
|
||||
--bits="${KEYSIZE}" \
|
||||
--subdomains \
|
||||
--DOMAIN="${DOMAINNAME}" \
|
||||
--domain="${DKIM_DOMAIN}" \
|
||||
--selector="${SELECTOR}" \
|
||||
-D "/tmp/docker-mailserver/opendkim/keys/${DOMAINNAME}"
|
||||
--directory="/tmp/docker-mailserver/opendkim/keys/${DKIM_DOMAIN}"
|
||||
fi
|
||||
|
||||
# write to KeyTable if necessary
|
||||
KEYTABLEENTRY="${SELECTOR}._domainkey.${DOMAINNAME} ${DOMAINNAME}:${SELECTOR}:/etc/opendkim/keys/${DOMAINNAME}/${SELECTOR}.private"
|
||||
KEYTABLEENTRY="${SELECTOR}._domainkey.${DKIM_DOMAIN} ${DKIM_DOMAIN}:${SELECTOR}:/etc/opendkim/keys/${DKIM_DOMAIN}/${SELECTOR}.private"
|
||||
if [[ ! -f "/tmp/docker-mailserver/opendkim/KeyTable" ]]
|
||||
then
|
||||
echo "Creating DKIM KeyTable"
|
||||
|
@ -169,11 +169,11 @@ do
|
|||
fi
|
||||
|
||||
# write to SigningTable if necessary
|
||||
SIGNINGTABLEENTRY="*@${DOMAINNAME} ${SELECTOR}._domainkey.${DOMAINNAME}"
|
||||
SIGNINGTABLEENTRY="*@${DKIM_DOMAIN} ${SELECTOR}._domainkey.${DKIM_DOMAIN}"
|
||||
if [[ ! -f /tmp/docker-mailserver/opendkim/SigningTable ]]
|
||||
then
|
||||
echo "Creating DKIM SigningTable"
|
||||
echo "*@${DOMAINNAME} ${SELECTOR}._domainkey.${DOMAINNAME}" >/tmp/docker-mailserver/opendkim/SigningTable
|
||||
echo "*@${DKIM_DOMAIN} ${SELECTOR}._domainkey.${DKIM_DOMAIN}" >/tmp/docker-mailserver/opendkim/SigningTable
|
||||
else
|
||||
if ! grep -q "${SIGNINGTABLEENTRY}" /tmp/docker-mailserver/opendkim/SigningTable
|
||||
then
|
||||
|
|
|
@ -21,7 +21,7 @@ function setup_file
|
|||
--name "${CONTAINER_NAME}" \
|
||||
--cap-add=SYS_PTRACE \
|
||||
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
||||
-v "${CDIR}/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-v "${PWD}/test/test-files":/tmp/docker-mailserver-test:ro \
|
||||
-e DEFAULT_RELAY_HOST=default.relay.host.invalid:25 \
|
||||
-e PERMIT_DOCKER=host \
|
||||
-e DMS_DEBUG=0 \
|
||||
|
|
Loading…
Reference in a new issue