Skip to content

Commit

Permalink
Fix #95: Make grep quiet
Browse files Browse the repository at this point in the history
Grep was missing the quiet (`-q`) option which made it echo the
password to postfix logs.
  • Loading branch information
bokysan committed Mar 28, 2022
1 parent 156b45d commit 3d750cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/common-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3d750cf

Please sign in to comment.