mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-11-14 06:51:15 +01:00
fix: Prevent logs leaking into config files (FETCHMAIL_PARALLEL=1) (#4586)
This commit is contained in:
parent
d0a915bd65
commit
9eb3fa73e5
@ -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**
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user