mirror of
https://github.com/mag37/dockcheck.git
synced 2026-02-15 07:48:14 +01:00
smtp-changes, deprecate ssmtp, suggest msmtp
This commit is contained in:
parent
de67cab998
commit
b1448fbb95
2 changed files with 29 additions and 4 deletions
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
Loading…
Add table
Add a link
Reference in a new issue