Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Correctly use test conditions in .docker/setup-mta.sh #2286

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .docker/setup-mta.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#!/bin/bash

# Make any changes only when MTA_HOST has been set
if [ -n MTA_HOST ]; then
if [ -n "$MTA_HOST" ]; then
echo "setting up configuration file for mail agent"
CONFIG="/etc/msmtprc"
echo "host $MTA_HOST" > $CONFIG
[ -n MTA_PORT ] && echo "port $MTA_PORT" >> $CONFIG
[ -n MTA_TLS ] && echo "tls $MTA_TLS" >> $CONFIG
[ -n MTA_STARTTLS ] && echo "tls_starttls $MTA_STARTTLS" >> $CONFIG
[ -n MTA_TLS_CERTCHECK ] && echo "tls_certcheck $MTA_TLS_CERTCHECK" >> $CONFIG
[ -n MTA_AUTH ] && echo "auth $MTA_AUTH" >> $CONFIG
[ -n MTA_USER ] && echo "user $MTA_USER" >> $CONFIG
[ -n MTA_FROM ] && echo "from $MTA_FROM" >> $CONFIG
[ -n MTA_PASSWORD ] && echo "password $MTA_PASSWORD" >> $CONFIG
[ -n MTA_LOGFILE ] && echo "logfile $MTA_LOGFILE" >> $CONFIG
[ -n "$MTA_PORT" ] && echo "port $MTA_PORT" >> $CONFIG
[ -n "$MTA_TLS" ] && echo "tls $MTA_TLS" >> $CONFIG
[ -n "$MTA_STARTTLS" ] && echo "tls_starttls $MTA_STARTTLS" >> $CONFIG
[ -n "$MTA_TLS_CERTCHECK" ] && echo "tls_certcheck $MTA_TLS_CERTCHECK" >> $CONFIG
[ -n "$MTA_AUTH" ] && echo "auth $MTA_AUTH" >> $CONFIG
[ -n "$MTA_USER" ] && echo "user $MTA_USER" >> $CONFIG
[ -n "$MTA_FROM" ] && echo "from $MTA_FROM" >> $CONFIG
[ -n "$MTA_PASSWORD" ] && echo "password $MTA_PASSWORD" >> $CONFIG
[ -n "$MTA_LOGFILE" ] && echo "logfile $MTA_LOGFILE" >> $CONFIG
chown gvmd:mail $CONFIG
chmod 750 $CONFIG
fi
Loading