fix: Prevent logs leaking into config files (FETCHMAIL_PARALLEL=1) (#4586)

This commit is contained in:
Lars K.W. Gohlke 2025-10-06 20:25:13 +02:00 committed by GitHub
parent d0a915bd65
commit 9eb3fa73e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 13 additions and 7 deletions

View File

@ -18,6 +18,7 @@ All notable changes to this project will be documented in this file. The format
- Third-party sourced CLI tools updated ([#4557](https://github.com/docker-mailserver/docker-mailserver/pull/4557)):
- `jaq` from `2.1.0` to [`2.3.0`](https://github.com/01mf02/jaq/releases/tag/v2.3.0)
- `step` CLI from `0.28.2` to [`0.28.7`](https://github.com/smallstep/cli/releases/tag/v0.28.7))
- DMS logs now all output to STDERR (formerly only warning/error logs) (#[4586](https://github.com/docker-mailserver/docker-mailserver/pull/4586))
- **Dovecot**
- Updated the FTS plugin Xapian from `1.9` to [`1.9.1`](https://github.com/grosjo/fts-xapian/releases/tag/1.9.1) which adds Dovecot 2.4 compatibility ([#4557](https://github.com/docker-mailserver/docker-mailserver/pull/4557))
- **Postfix**

View File

@ -104,11 +104,9 @@ function _log() {
MESSAGE="$(date --rfc-3339='seconds') ${!LOG_COLOR}${LOG_LEVEL_NAME}${RESET} $(basename "${0}"): ${2}"
if [[ ${1} =~ ^(warn|error)$ ]]; then
echo -e "${MESSAGE}" >&2
else
echo -e "${MESSAGE}"
fi
# All logs should go through to STDERR,
# STDOUT is only appropriate for expected program output
echo -e "${MESSAGE}" >&2
}
# Get the value of the environment variable LOG_LEVEL if

View File

@ -77,8 +77,8 @@ function _setup_fetchmail_parallel() {
local COUNTER=0
for RC in /etc/fetchmailrc.d/fetchmail-*.rc; do
COUNTER=$(( COUNTER + 1 ))
cat >"/etc/supervisor/conf.d/fetchmail-${COUNTER}.conf" << EOF
COUNTER=$(( COUNTER + 1 ))
cat >"/etc/supervisor/conf.d/fetchmail-${COUNTER}.conf" << EOF
[program:fetchmail-${COUNTER}]
startsecs=0
autostart=false

View File

@ -60,6 +60,13 @@ function teardown_file() {
_should_not_have_in_config 'pop3.third-party.test. ' /etc/fetchmailrc.d/fetchmail-2.rc
}
@test "(ENV FETCHMAIL_PARALLEL=1) should not have logs emitted into fetchmail-x.rc" {
export CONTAINER_NAME=${CONTAINER2_NAME}
_should_not_have_in_config 'INFO' /etc/fetchmailrc.d/fetchmail-1.rc
_should_not_have_in_config 'INFO' /etc/fetchmailrc.d/fetchmail-2.rc
}
function _should_have_in_config() {
local MATCH_CONTENT=$1
local MATCH_IN_FILE=$2