mirror of
https://github.com/chatmail/relay.git
synced 2026-05-20 04:48:06 +00:00
docker: fix DKIM key permission denied on bind-mounted volumes
chown the entire /etc/acmekeys directory
This commit is contained in:
@@ -15,7 +15,9 @@ services:
|
|||||||
# - ./data/chatmail-dkimkeys:/etc/dkimkeys
|
# - ./data/chatmail-dkimkeys:/etc/dkimkeys
|
||||||
# - ./data/chatmail-acme:/var/lib/acme
|
# - ./data/chatmail-acme:/var/lib/acme
|
||||||
|
|
||||||
## Or mount data from an existing bare-metal install:
|
## Or mount data from an existing bare-metal install.
|
||||||
|
## Note: DKIM key ownership is fixed automatically on startup
|
||||||
|
## (the host's opendkim UID may differ from the container's).
|
||||||
# - /home/vmail:/home/vmail
|
# - /home/vmail:/home/vmail
|
||||||
# - /etc/dkimkeys:/etc/dkimkeys
|
# - /etc/dkimkeys:/etc/dkimkeys
|
||||||
# - /var/lib/acme:/var/lib/acme
|
# - /var/lib/acme:/var/lib/acme
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ fi
|
|||||||
if [ ! -f /etc/dkimkeys/opendkim.private ]; then
|
if [ ! -f /etc/dkimkeys/opendkim.private ]; then
|
||||||
/usr/sbin/opendkim-genkey -D /etc/dkimkeys -d "$MAIL_DOMAIN" -s opendkim
|
/usr/sbin/opendkim-genkey -D /etc/dkimkeys -d "$MAIL_DOMAIN" -s opendkim
|
||||||
fi
|
fi
|
||||||
chown opendkim:opendkim /etc/dkimkeys/opendkim.private
|
# Fix ownership for bind-mounted keys (host opendkim UID may differ from container)
|
||||||
chown opendkim:opendkim /etc/dkimkeys/opendkim.txt
|
chown -R opendkim:opendkim /etc/dkimkeys
|
||||||
|
|
||||||
# Create chatmail.ini (skips if file already exists, e.g. volume-mounted)
|
# Create chatmail.ini (skips if file already exists, e.g. volume-mounted)
|
||||||
mkdir -p "$(dirname "$CHATMAIL_INI")"
|
mkdir -p "$(dirname "$CHATMAIL_INI")"
|
||||||
|
|||||||
Reference in New Issue
Block a user