mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-11-15 07:21:22 +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)):
|
- 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)
|
- `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))
|
- `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**
|
- **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))
|
- 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**
|
- **Postfix**
|
||||||
|
|||||||
@ -104,11 +104,9 @@ function _log() {
|
|||||||
|
|
||||||
MESSAGE="$(date --rfc-3339='seconds') ${!LOG_COLOR}${LOG_LEVEL_NAME}${RESET} $(basename "${0}"): ${2}"
|
MESSAGE="$(date --rfc-3339='seconds') ${!LOG_COLOR}${LOG_LEVEL_NAME}${RESET} $(basename "${0}"): ${2}"
|
||||||
|
|
||||||
if [[ ${1} =~ ^(warn|error)$ ]]; then
|
# All logs should go through to STDERR,
|
||||||
echo -e "${MESSAGE}" >&2
|
# STDOUT is only appropriate for expected program output
|
||||||
else
|
echo -e "${MESSAGE}" >&2
|
||||||
echo -e "${MESSAGE}"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Get the value of the environment variable LOG_LEVEL if
|
# Get the value of the environment variable LOG_LEVEL if
|
||||||
|
|||||||
@ -77,8 +77,8 @@ function _setup_fetchmail_parallel() {
|
|||||||
|
|
||||||
local COUNTER=0
|
local COUNTER=0
|
||||||
for RC in /etc/fetchmailrc.d/fetchmail-*.rc; do
|
for RC in /etc/fetchmailrc.d/fetchmail-*.rc; do
|
||||||
COUNTER=$(( COUNTER + 1 ))
|
COUNTER=$(( COUNTER + 1 ))
|
||||||
cat >"/etc/supervisor/conf.d/fetchmail-${COUNTER}.conf" << EOF
|
cat >"/etc/supervisor/conf.d/fetchmail-${COUNTER}.conf" << EOF
|
||||||
[program:fetchmail-${COUNTER}]
|
[program:fetchmail-${COUNTER}]
|
||||||
startsecs=0
|
startsecs=0
|
||||||
autostart=false
|
autostart=false
|
||||||
|
|||||||
@ -60,6 +60,13 @@ function teardown_file() {
|
|||||||
_should_not_have_in_config 'pop3.third-party.test. ' /etc/fetchmailrc.d/fetchmail-2.rc
|
_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() {
|
function _should_have_in_config() {
|
||||||
local MATCH_CONTENT=$1
|
local MATCH_CONTENT=$1
|
||||||
local MATCH_IN_FILE=$2
|
local MATCH_IN_FILE=$2
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user