smtp-changes, deprecate ssmtp, suggest msmtp

This commit is contained in:
mag37 2024-07-24 12:18:23 +02:00
parent de67cab998
commit b1448fbb95
2 changed files with 29 additions and 4 deletions

View file

@ -1,9 +1,22 @@
### DISCLAIMER: This is a third party addition to dockcheck - best effort testing.
# INFO: ssmtp is depcerated - consider to use msmtp instead.
#
# Copy/rename this file to notify.sh to enable email notifications on Synology DSM
# Copy/rename this file to notify.sh to enable the notification snipppet.
# mSMTP/sSMTP has to be installed and configured manually.
# The existing DSM Notification Email configuration will be used automatically.
# Modify to your liking - changing SendMailTo and Subject and content.
MSMTP=$(which msmtp)
SSMTP=$(which ssmtp)
if [ -n $MSMPT ] ; then
MAIL=$MSMTP
elif [ -n $SSMTP ] && [ -z $MAIL ] ; then
MAIL=$SSMTP
else
echo "No msmtp or ssmtp binary found in PATH: $PATH" ; exit 1
fi
send_notification() {
Updates=("$@")
UpdToString=$( printf "%s\n" "${Updates[@]}" )
@ -23,7 +36,7 @@ SenderMail=${SenderMail:-$(grep 'eventmail1' $CfgFile | sed -n 's/.*"\([^"]*\)".
printf "\nSending email notification.\n"
ssmtp $SendMailTo << __EOF
$MAIL $SendMailTo << __EOF
From: "$SenderName" <$SenderMail>
date:$(date -R)
To: <$SendMailTo>

View file

@ -1,9 +1,21 @@
### DISCLAIMER: This is a third party addition to dockcheck - best effort testing.
# INFO: ssmtp is depcerated - consider to use msmtp instead.
#
# Copy/rename this file to notify.sh to enable the notification snipppet.
# sSMTP has to be installed and configured manually.
# mSMTP/sSMTP has to be installed and configured manually.
# Modify to fit your setup - changing SendMailFrom, SendMailTo, SubjectTag
MSMTP=$(which msmtp)
SSMTP=$(which ssmtp)
if [ -n $MSMPT ] ; then
MAIL=$MSMTP
elif [ -n $SSMTP ] && [ -z $MAIL ] ; then
MAIL=$SSMTP
else
echo "No msmtp or ssmtp binary found in PATH: $PATH" ; exit 1
fi
send_notification() {
Updates=("$@")
UpdToString=$( printf "%s\n" "${Updates[@]}" )
@ -16,7 +28,7 @@ SubjectTag="dockcheck"
printf "\nSending email notification.\n"
ssmtp $SendMailTo << __EOF
$MAIL $SendMailTo << __EOF
From: "$FromHost" <$SendMailFrom>
date:$(date -R)
To: <$SendMailTo>