Finish support of subject (utf-8) encoding - forgot sample configuration file.
This commit is contained in:
parent
3802e50061
commit
3f2a913d22
@ -22,7 +22,7 @@
|
|||||||
#admin_email="argus@oopen.de"
|
#admin_email="argus@oopen.de"
|
||||||
#from_address="root@`hostname -f`"
|
#from_address="root@`hostname -f`"
|
||||||
#company="Warenform INET"
|
#company="Warenform INET"
|
||||||
#logFile=/backup/log/rsync.log
|
#logFile=/backup/log/rcopy.log
|
||||||
#label
|
#label
|
||||||
|
|
||||||
durations_top="\nBackup durations of the certain hosts:\n"
|
durations_top="\nBackup durations of the certain hosts:\n"
|
||||||
@ -30,11 +30,15 @@
|
|||||||
|
|
||||||
send=`cat $logFile`
|
send=`cat $logFile`
|
||||||
|
|
||||||
datum=`date +"%d.%m.%Y"`
|
datum="$(date +"%d.%m.%Y")"
|
||||||
|
|
||||||
echo -e "To:${admin_email}\n${content_type}\nSubject:Backup $company -- $datum\n$filesystem\n\nBackup resource / Label: $label\n$durations\n\n$send\n" | /usr/sbin/sendmail -F "BACKUP $company" -f $from_address $admin_email
|
subject="Backup $company -- $datum"
|
||||||
|
subject_utf8="$(echo "$subject" | iconv -t UTF8)"
|
||||||
|
subject_utf8_encoded="=?utf-8?B?$(echo $subject_utf8 | base64 --wrap=0)?="
|
||||||
|
|
||||||
|
echo -e "To:${admin_email}\n${content_type}\nSubject:${subject_utf8_encoded}\n$filesystem\n\nBackup resource / Label: $label\n$durations\n\n$send\n" | /usr/sbin/sendmail -F "BACKUP $company" -f $from_address $admin_email
|
||||||
if [[ -n "$extra_admin_email" ]]; then
|
if [[ -n "$extra_admin_email" ]]; then
|
||||||
echo -e "To:${extra_admin_email}\n${content_type}\nSubject:Backup $company -- $datum\n$filesystem\n\nBackup resource / Labe: $label\n$durations\n\n$send\n" | /usr/sbin/sendmail -F "BACKUP $company" -f $from_address $extra_admin_email
|
echo -e "To:${extra_admin_email}\n${content_type}\nSubject:${subject_utf8_encoded}\n$filesystem\n\nBackup resource / Labe: $label\n$durations\n\n$send\n" | /usr/sbin/sendmail -F "BACKUP $company" -f $from_address $extra_admin_email
|
||||||
fi
|
fi
|
||||||
|
|
||||||
declare -i error=`grep -e"\[ERROR" $logFile | wc -l`
|
declare -i error=`grep -e"\[ERROR" $logFile | wc -l`
|
||||||
@ -51,9 +55,13 @@
|
|||||||
|
|
||||||
msg="${msg_top}\n${msg_body_01}\n${msg_body_02}"
|
msg="${msg_top}\n${msg_body_01}\n${msg_body_02}"
|
||||||
|
|
||||||
echo -e "To:${admin_email}\n${content_type}\nSubject:Backup Errors $company -- $datum\n${msg}" | /usr/sbin/sendmail -F "Errors BACKUP $company" -f $from_address $admin_email
|
subject="Backup Errors $company -- $datum"
|
||||||
|
subject_utf8="$(echo "$subject" | iconv -t UTF8)"
|
||||||
|
subject_utf8_encoded="=?utf-8?B?$(echo $subject_utf8 | base64 --wrap=0)?="
|
||||||
|
|
||||||
|
echo -e "To:${admin_email}\n${content_type}\nSubject:${subject_utf8_encoded}\n${msg}" | /usr/sbin/sendmail -F "Errors BACKUP $company" -f $from_address $admin_email
|
||||||
if [ "X$extra_error_email" != "X" ]; then
|
if [ "X$extra_error_email" != "X" ]; then
|
||||||
echo -e "To:${extra_error_email}\n${content_type}\nSubject:Backup Errors $company -- $datum\n${msg}" | /usr/sbin/sendmail -F "Errors BACKUP $company" -f $from_address $extra_error_email
|
echo -e "To:${extra_error_email}\n${content_type}\nSubject:${subject_utf8_encoded}\n${msg}" | /usr/sbin/sendmail -F "Errors BACKUP $company" -f $from_address $extra_error_email
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user