From 6031036ae1a3e01803a81521080547ff9e712ddb Mon Sep 17 00:00:00 2001 From: deajan Date: Sun, 5 Feb 2017 13:11:00 +0100 Subject: [PATCH] Trying to resolve mail encoding issues --- dev/ofunctions.sh | 8 ++++++-- sync.conf.example | 7 ++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/dev/ofunctions.sh b/dev/ofunctions.sh index 4cd4d9f..8169e0f 100644 --- a/dev/ofunctions.sh +++ b/dev/ofunctions.sh @@ -3,7 +3,7 @@ #### OFUNCTIONS MINI SUBSET #### _OFUNCTIONS_VERSION=2.1-RC1+dev -_OFUNCTIONS_BUILD=2017020302 +_OFUNCTIONS_BUILD=2017020501 #### _OFUNCTIONS_BOOTSTRAP SUBSET #### _OFUNCTIONS_BOOTSTRAP=true #### _OFUNCTIONS_BOOTSTRAP SUBSET END #### @@ -387,7 +387,11 @@ function SendAlert { attachment=true fi if [ -e "$RUN_DIR/$PROGRAM._Logger.$SCRIPT_PID.$TSTAMP" ]; then - body="$MAIL_ALERT_MSG"$'\n\n'"$(cat $RUN_DIR/$PROGRAM._Logger.$SCRIPT_PID.$TSTAMP)" + if [ "$MAIL_BODY_CHARSET" != "" ] && type iconv > /dev/null 2>&1; then + body="$MAIL_ALERT_MSG"$'\n\n'"$(iconv -f UTF-8 -t $MAIL_BODY_CHARSET $RUN_DIR/$PROGRAM._Logger.$SCRIPT_PID.$TSTAMP)" + else + body="$MAIL_ALERT_MSG"$'\n\n'"$(cat $RUN_DIR/$PROGRAM._Logger.$SCRIPT_PID.$TSTAMP)" + fi fi if [ $ERROR_ALERT == true ]; then diff --git a/sync.conf.example b/sync.conf.example index 573d3e4..e491d5a 100644 --- a/sync.conf.example +++ b/sync.conf.example @@ -2,7 +2,7 @@ ###### osync - Rsync based two way sync engine with fault tolerance ###### (C) 2013-2016 by Orsiris de Jong (www.netpower.fr) -###### osync v1.1x / v1.2x config file rev 2016121301 +###### osync v1.1x / v1.2x config file rev 2017020501 ## ---------- GENERAL OPTIONS @@ -163,6 +163,11 @@ DELTA_COPIES=yes ## on pfSense platform, smtp support needs to be configured in System > Advanced > Notifications DESTINATION_MAILS="your@alert.tld" +## Optional change of mail body encoding (using iconv) +## By default, all mails are sent in UTF-8 format without header (because of maximum compatibility of all platforms) +## You may specify an optional encoding here (like "ISO-8859-1" or whatever iconv can handle) +MAIL_BODY_CHARSET="" + ## Additional mail parameters needed for Android / Busybox / Cygwin / MSYS ## Android & Busybox use sendmail (and openssl if encryption is needed) ## MSYS & Cygwin Windows mail support relies on mailsend.exe from muquit, http://github.com/muquit/mailsend which needs to be in %PATH% environment variable