2ad58dc07ee7f5dc0661c9f0cc515be6f03e3c6c

Author
Daniel Gibbs <me@danielgibbs.co.uk>
Committer
GitHub <noreply@github.com>
Date

Message

[hostname] contains invalid character '[' in CentOS 7

[hostname] contains invalid character '[' in CentOS 7 changed [ to (

See https://www.jethrocarr.com/2012/06/10/mailx-contains-invalid-character-2/

There may be a better way to resolve this however this quick fix works

Diff

 1diff --git a/duplicity-backup.sh b/duplicity-backup.sh
 2index 213f7f72399671e6756049c87c1bf7c2d9358d23..932d8ba2f4c0762c6220066f4ce43726a57864dc 100755
 3--- a/duplicity-backup.sh
 4+++ b/duplicity-backup.sh
 5@@ -488,7 +488,7 @@ email_logfile()
 6       if [ ! -x "${MAILCMD}" ]; then
 7           echo -e "Email couldn't be sent. ${MAIL} not available." >&2
 8       else
 9-          EMAIL_SUBJECT=${EMAIL_SUBJECT:="duplicity-backup ${BACKUP_STATUS:-"ERROR"} [${HOSTNAME}] ${LOG_FILE}"}
10+          EMAIL_SUBJECT=${EMAIL_SUBJECT:="duplicity-backup ${BACKUP_STATUS:-"ERROR"} (${HOSTNAME}) ${LOG_FILE}"}
11           case ${MAIL} in
12             ssmtp)
13               mailcmd_ssmtp;;