Add support for mail sending via msmtp
(adapted cherry-pick from commit 7f8b9b6e2fb49ce3bae166674a06754e5940ea04 of Dosenpfand)
This commit is contained in:
parent
5c99b4c3ca
commit
dd05ff68b6
2 changed files with 3 additions and 0 deletions
|
|
@ -209,6 +209,7 @@ MAIL="mailx" # default command for Linux mail
|
|||
#MAIL="mail" # for CentOS, if "mailx" fails try this one
|
||||
#MAIL="ssmtp"
|
||||
#MAIL="sendmail"
|
||||
#MAIL="msmtp"
|
||||
|
||||
# TROUBLESHOOTING: If you are having any problems running this script it is
|
||||
# helpful to see the command output that is being generated to determine if the
|
||||
|
|
|
|||
|
|
@ -271,6 +271,8 @@ email_logfile()
|
|||
EMAIL_SUBJECT=${EMAIL_SUBJECT:="duplicity-backup alert ${LOG_FILE}"}
|
||||
if [ "$MAIL" = "ssmtp" ]; then
|
||||
echo """Subject: ${EMAIL_SUBJECT}""" | cat - ${LOGFILE} | ${MAILCMD} -s ${EMAIL_TO}
|
||||
elif [ "$MAIL" = "msmtp" ]; then
|
||||
echo """Subject: ${EMAIL_SUBJECT}""" | cat - ${LOGFILE} | ${MAILCMD} ${EMAIL_TO}
|
||||
elif [ "$MAIL" = "mailx" ]; then
|
||||
EMAIL_FROM=${EMAIL_FROM:+"-r ${EMAIL_FROM}"}
|
||||
cat ${LOGFILE} | ${MAILCMD} -s """${EMAIL_SUBJECT}""" $EMAIL_FROM ${EMAIL_TO}
|
||||
|
|
|
|||
Loading…
Reference in a new issue