From a3571a88c135f7f6a627d82d312fbae6b1c7b817 Mon Sep 17 00:00:00 2001 From: Brennan Kinney <5098581+polarathene@users.noreply.github.com> Date: Wed, 19 Mar 2025 11:48:12 +1300 Subject: [PATCH] fix: DMS state volume must ensure `o+x` permission (#4420) --- CHANGELOG.md | 5 ++++- target/scripts/startup/setup.d/mail_state.sh | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9112877b..d5929c5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,14 +17,17 @@ All notable changes to this project will be documented in this file. The format - Gender-neutral language - **Postfix:** - `setup email restrict` generated configs now only prepend to `dms_smtpd_sender_restrictions` ([#4379](https://github.com/docker-mailserver/docker-mailserver/pull/4379)) +- **Rspamd:** + - Change detection support now monitors all files found within the DMS _Config Volume_ Rspamd directory ([#4418](https://github.com/docker-mailserver/docker-mailserver/pull/4418)) - **Internal:** - A permissions fix for `/var/log/mail` that was [added in DMS v15]((https://github.com/docker-mailserver/docker-mailserver/pull/4374)) no longer encounters an error when no log files are present during a container restart, such as with a `tmpfs` volume mount ([#4391](https://github.com/docker-mailserver/docker-mailserver/pull/4391)) + - The DMS _State Volume_ (`/var/mail-state`) will now ensure it's file tree is accessible for services when the volume was created with missing executable bit ([#4420](https://github.com/docker-mailserver/docker-mailserver/pull/4420)) + - The DMS _Config Volume_ (`/tmp/docker-mailserver`) now correctly updates permissions on container restarts ([#4417](https://github.com/docker-mailserver/docker-mailserver/pull/4417)) ### Updates - **Internal:** - Minor improvements to `_install_utils()` in `packages.sh` ([#4376](https://github.com/docker-mailserver/docker-mailserver/pull/4376)) - - Change detection support for Rspamd now monitors all files at the rspamd Config Volume directory ([#4418](https://github.com/docker-mailserver/docker-mailserver/pull/4418)) ## [v15.0.0](https://github.com/docker-mailserver/docker-mailserver/releases/tag/v15.0.0) diff --git a/target/scripts/startup/setup.d/mail_state.sh b/target/scripts/startup/setup.d/mail_state.sh index 34623859..7bcd8be3 100644 --- a/target/scripts/startup/setup.d/mail_state.sh +++ b/target/scripts/startup/setup.d/mail_state.sh @@ -95,6 +95,11 @@ function _setup_save_states() { function _setup_adjust_state_permissions() { [[ ! -d ${DMS_STATE_DIR} ]] && return 0 + # Parent directories must have executable bit set to descend the file tree for access, + # as each service running as a non-root user requires this to access their state directory, + # `/var/mail-state` must allow all users `+x`: + chmod +x "${DMS_STATE_DIR}" + # This ensures the user and group of the files from the external mount have their # numeric ID values in sync. New releases where the installed packages order changes # can change the values in the Docker image, causing an ownership mismatch.