From d724e5b3fa5dbc154478a4e396697af9d6573e21 Mon Sep 17 00:00:00 2001 From: Jonathan Gazeley Date: Mon, 11 Nov 2024 16:03:41 +0000 Subject: [PATCH] Check for writability of sasl_passwd --- smtp-relay.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/smtp-relay.sh b/smtp-relay.sh index 5c47986..7c95833 100755 --- a/smtp-relay.sh +++ b/smtp-relay.sh @@ -10,9 +10,8 @@ SMTP_TLS_SECURITY_LEVEL=${SMTP_TLS_SECURITY_LEVEL?Missing env var SMTP_TLS_SECUR # handle sasl -echo "${SMTP_RELAY_HOST} ${SMTP_RELAY_USERNAME}:${SMTP_RELAY_PASSWORD}" > /etc/postfix/sasl_passwd || exit 1 +[ -w /etc/postfix/sasl_passwd ] && echo "${SMTP_RELAY_HOST} ${SMTP_RELAY_USERNAME}:${SMTP_RELAY_PASSWORD}" > /etc/postfix/sasl_passwd || exit 1 postmap /etc/postfix/sasl_passwd || exit 1 -rm /etc/postfix/sasl_passwd || exit 1 postconf 'smtp_sasl_auth_enable = yes' || exit 1 postconf 'smtp_sasl_password_maps = lmdb:/etc/postfix/sasl_passwd' || exit 1