From dd05ff68b6bc593edd2b13ee950d510f883ddd0e Mon Sep 17 00:00:00 2001 From: zertrin Date: Wed, 13 Nov 2013 19:55:47 +0100 Subject: [PATCH] Add support for mail sending via msmtp (adapted cherry-pick from commit 7f8b9b6e2fb49ce3bae166674a06754e5940ea04 of Dosenpfand) --- duplicity-backup.conf.example | 1 + duplicity-backup.sh | 2 ++ 2 files changed, 3 insertions(+) diff --git a/duplicity-backup.conf.example b/duplicity-backup.conf.example index c81aaf7..168e28c 100644 --- a/duplicity-backup.conf.example +++ b/duplicity-backup.conf.example @@ -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 diff --git a/duplicity-backup.sh b/duplicity-backup.sh index 0228866..6dec36f 100755 --- a/duplicity-backup.sh +++ b/duplicity-backup.sh @@ -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}