From 3d750cfb6a57c8a5d4c878e43315e3edee7e9ad6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bojan=20=C4=8Cekrli=C4=87?= Date: Mon, 28 Mar 2022 19:51:47 +0200 Subject: [PATCH] Fix #95: Make grep quiet Grep was missing the quiet (`-q`) option which made it echo the password to postfix logs. --- scripts/common-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/common-run.sh b/scripts/common-run.sh index 9a6dd22..b02f86f 100755 --- a/scripts/common-run.sh +++ b/scripts/common-run.sh @@ -199,7 +199,7 @@ postfix_setup_relayhost() { if [ -n "$RELAYHOST_USERNAME" ] && [ -n "$RELAYHOST_PASSWORD" ]; then echo -e " using username ${emphasis}$RELAYHOST_USERNAME${reset} and password ${emphasis}(redacted)${reset}." if [[ -f /etc/postfix/sasl_passwd ]]; then - if ! grep -F "$SASL_RELAYHOST $RELAYHOST_USERNAME:$RELAYHOST_PASSWORD" /etc/postfix/sasl_passwd; then + if ! grep -q -F "$SASL_RELAYHOST $RELAYHOST_USERNAME:$RELAYHOST_PASSWORD" /etc/postfix/sasl_passwd; then sed -i -e "/^$SASL_RELAYHOST .*$/d" /etc/postfix/sasl_passwd echo "$SASL_RELAYHOST $RELAYHOST_USERNAME:$RELAYHOST_PASSWORD" >> /etc/postfix/sasl_passwd fi