Reverted
All checks were successful
Build and push Docker image on tag / docker (push) Successful in 7s

This commit is contained in:
2026-03-28 07:29:43 +01:00
parent 04384fbb7d
commit 18ba6035f3
2 changed files with 60 additions and 6 deletions

View File

@@ -46,7 +46,7 @@ mkdir -p \
/var/lib/opendkim \
/var/opendkim
touch /etc/opendkim/TrustedHosts /etc/opendkim/KeyTable /etc/opendkim/SigningTable
touch /etc/opendkim/KeyTable /etc/opendkim/SigningTable
chown -R "${OPENDKIM_USER}:${OPENDKIM_GROUP}" /run/opendkim /var/lib/opendkim /var/opendkim
chmod 0755 /run/opendkim /var/lib/opendkim /var/opendkim
@@ -58,16 +58,31 @@ if [ -f "${OPENDKIM_KEYFILE}" ]; then
chmod 0600 /var/opendkim/dkim.private
fi
# Generate TrustedHosts from env if file is empty.
if [ ! -s /etc/opendkim/TrustedHosts ]; then
printf '%s\n' "${OPENDKIM_INTERNALHOSTS}" | tr ',' '\n' > /etc/opendkim/TrustedHosts
# Generate KeyTable from env if file is empty.
if [ ! -s /etc/opendkim/KeyTable ]; then
printf '%s._domainkey.%s %s:%s:/var/opendkim/dkim.private\n' \
"${OPENDKIM_SELECTOR}" \
"${OPENDKIM_DOMAIN}" \
"${OPENDKIM_DOMAIN}" \
"${OPENDKIM_SELECTOR}" \
> /etc/opendkim/KeyTable
fi
# Generate SigningTable from env if file is empty.
if [ ! -s /etc/opendkim/SigningTable ]; then
printf '*@%s %s._domainkey.%s\n' \
"${OPENDKIM_DOMAIN}" \
"${OPENDKIM_SELECTOR}" \
"${OPENDKIM_DOMAIN}" \
> /etc/opendkim/SigningTable
fi
chown "${OPENDKIM_USER}:${OPENDKIM_GROUP}" /etc/opendkim/TrustedHosts /etc/opendkim/KeyTable /etc/opendkim/SigningTable
cat > /etc/opendkim.conf <<EOF
Syslog yes
LogWhy yes
UMask ${OPENDKIM_UMASK}
Domain ${OPENDKIM_DOMAIN}
Canonicalization ${OPENDKIM_CANONICALIZATION}
Mode ${OPENDKIM_MODE}
SubDomains ${OPENDKIM_SUBDOMAINS}
@@ -75,6 +90,8 @@ OversignHeaders ${OPENDKIM_OVERSIGNHEADERS}
UserID ${OPENDKIM_USERID}
Socket ${OPENDKIM_SOCKET}
PidFile ${OPENDKIM_PIDFILE}
KeyTable ${OPENDKIM_KEYTABLE}
SigningTable ${OPENDKIM_SIGNINGTABLE}
InternalHosts ${OPENDKIM_INTERNALHOSTS}
AutoRestart ${OPENDKIM_AUTO_RESTART}
AutoRestartRate ${OPENDKIM_AUTO_RESTART_RATE}