[fix] Make sure relay_user var exists in all cases (otherwise in the jinja template later, relay_user != "" is True if the var doesn't exists...)

This commit is contained in:
Alexandre Aubin 2021-01-08 15:57:41 +01:00 committed by GitHub
parent f56a00d4a7
commit b25cde0b67
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -26,11 +26,13 @@ do_pre_regen() {
# Add possibility to specify a relay
# Could be useful with some isp with no 25 port open or more complex setup
export relay_port=""
export relay_user=""
export relay_host="$(yunohost settings get 'smtp.relay.host')"
if [ -n "${relay_host}" ]
then
export relay_port="$(yunohost settings get 'smtp.relay.port')"
export relay_user="$(yunohost settings get 'smtp.relay.user')"
relay_port="$(yunohost settings get 'smtp.relay.port')"
relay_user="$(yunohost settings get 'smtp.relay.user')"
relay_password="$(yunohost settings get 'smtp.relay.password')"
# Avoid to display "Relay account paswword" to other users