Skip to content

Commit 1a35a16

Browse files
committed
docker: fix DKIM key permission denied on bind-mounted volumes
chown entire directory
1 parent 35c7a58 commit 1a35a16

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

docker/docker-compose.override.yaml.example

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ services:
1515
# - ./data/chatmail-dkimkeys:/etc/dkimkeys
1616
# - ./data/chatmail-acme:/var/lib/acme
1717

18-
## Or mount data from an existing bare-metal install:
18+
## Or mount data from an existing bare-metal install.
19+
## Note: DKIM key ownership is fixed automatically on startup
20+
## (the host's opendkim UID may differ from the container's).
1921
# - /home/vmail:/home/vmail
2022
# - /etc/dkimkeys:/etc/dkimkeys
2123
# - /var/lib/acme:/var/lib/acme

docker/files/setup_chatmail_docker.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ fi
1515
if [ ! -f /etc/dkimkeys/opendkim.private ]; then
1616
/usr/sbin/opendkim-genkey -D /etc/dkimkeys -d "$MAIL_DOMAIN" -s opendkim
1717
fi
18-
chown opendkim:opendkim /etc/dkimkeys/opendkim.private
19-
chown opendkim:opendkim /etc/dkimkeys/opendkim.txt
18+
# Fix ownership for bind-mounted keys (host opendkim UID may differ from container)
19+
chown -R opendkim:opendkim /etc/dkimkeys
2020

2121
# Create chatmail.ini (skips if file already exists, e.g. volume-mounted)
2222
mkdir -p "$(dirname "$CHATMAIL_INI")"

0 commit comments

Comments
 (0)