From bf84322ca67db079ecefd1be7616895befa8ca11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20De=20Marchi?= <116717000+SebastienDEMARCHI@users.noreply.github.com> Date: Thu, 18 Jan 2024 14:11:46 +0100 Subject: [PATCH] Fix sasldb with SMTPD_SASL_USERS env variable We encountered an issue where the script common-run.sh would fail if the SMTPD_SASL_USERS environment variable was defined. The failure occurred immediately after displaying the "Enable smtpd sasl auth" message, preventing the container from starting correctly. The root cause was traced to a conditional check for the existence of the /etc/sasl2/sasldb2 file. When the file did not exist, the subsequent `chown` operation was skipped as intended, but the script would still fail due to an undefined behavior in the shell context. The addition of a debug message "Sasldb configured" before the closing `fi` statement has resolved the issue. This change appears to stabilize the script execution, allowing the container to start as expected. While the underlying cause is not fully understood and warrants further investigation, this commit serves as a temporary workaround to ensure functionality in environments where SMTPD_SASL_USERS is set. --- scripts/common-run.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/common-run.sh b/scripts/common-run.sh index 416a1f0..06b61df 100755 --- a/scripts/common-run.sh +++ b/scripts/common-run.sh @@ -430,6 +430,7 @@ EOF [ -f /etc/sasldb2 ] && chown postfix:postfix /etc/sasldb2 [ -f /etc/sasl2/sasldb2 ] && chown postfix:postfix /etc/sasl2/sasldb2 + debug 'Sasldb configured' fi }