Allow to configure mail notification host

This commit is contained in:
Dennis Reimann 2020-06-27 21:17:40 +02:00
parent ae68f8f8e8
commit e966207aec
No known key found for this signature in database
GPG key ID: 5009E1797F03F8D0

View file

@ -33,7 +33,11 @@ if ! grep -Eq "^notifyMailTo=.*" /mnt/hdd/raspiblitz.conf; then
fi
if ! grep -Eq "^notifyMailServer=.*" /mnt/hdd/raspiblitz.conf; then
echo "notifyMailServer=mail@example.com" | sudo tee -a /mnt/hdd/raspiblitz.conf >/dev/null
echo "notifyMailServer=mail.example.com" | sudo tee -a /mnt/hdd/raspiblitz.conf >/dev/null
fi
if ! grep -Eq "^notifyMailHostname=.*" /mnt/hdd/raspiblitz.conf; then
echo "notifyMailHostname=$(hostname)" | sudo tee -a /mnt/hdd/raspiblitz.conf >/dev/null
fi
if ! grep -Eq "^notifyMailUser=.*" /mnt/hdd/raspiblitz.conf; then
@ -81,13 +85,13 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
root=${notifyMailTo}
Root=${notifyMailTo}
# hostname of this system
hostname=${hostname}
Hostname=${notifyMailHostname}
# relay/smarthost server settings
mailhub=${notifyMailServer}
Mailhub=${notifyMailServer}
AuthUser=${notifyMailUser}
AuthPass=${notifyMailPass}
UseSTARTTLS=YES
@ -141,7 +145,7 @@ if [ "$1" = "send" ]; then
elif [ "${notifyMethod}" = "slack" ]; then
/home/admin/python3-env-lnd/bin/python3 /home/admin/XXsendNotification.py slack -h "$2"
else
echo "unknown notification method - check /mnt/hdd/raspiblitz.con"
echo "unknown notification method - check /mnt/hdd/raspiblitz.conf"
fi
exit 0