From acaa968748dc9c0da679635e529dac093397d01b Mon Sep 17 00:00:00 2001 From: Christoph Date: Thu, 4 Jul 2019 18:38:44 +0200 Subject: [PATCH] reminder_email.sh: add support for quoted-printable. --- reminder_email.sh | 42 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/reminder_email.sh b/reminder_email.sh index c40b3b5..4419bbe 100755 --- a/reminder_email.sh +++ b/reminder_email.sh @@ -240,22 +240,58 @@ fi echo "$MESSAGE" > ${LOCK_DIR}/message_tmp.txt echo "$SUBJECT" > ${LOCK_DIR}/subject_tmp.txt + +# ===== # - Send E-Mail using ISO-8859-15 Charset +# ===== + +# - Convert to ISO-8859-15 # - #iconv -t ISO-8859-15 -o ${LOCK_DIR}/subject_tmp_ISO-8859-15.txt ${LOCK_DIR}/subject_tmp.txt #iconv -t ISO-8859-15 -o ${LOCK_DIR}/message_tmp_ISO-8859-15.txt ${LOCK_DIR}/message_tmp.txt -#ENCODED_MESSAGE="$(cat ${LOCK_DIR}/message_tmp_ISO-8859-15.txt | base64)" + +# - encode base64 +# - #ENCODED_SUBJECT="=?iso-8859-15?B?$(cat ${LOCK_DIR}/subject_tmp_ISO-8859-15.txt | base64 --wrap=0)?=" +#ENCODED_MESSAGE="$(cat ${LOCK_DIR}/message_tmp_ISO-8859-15.txt | base64)" #content_type='Content-Type: text/plain;\n charset="iso-8859-15"' +#transfer_encoding='Content-Transfer-Encoding: base64' +#content_disposition='Content-Disposition: inline' + +# - encode quoted-printable +# - +#ENCODED_SUBJECT="=?iso-8859-15?Q?$(cat ${LOCK_DIR}/subject_tmp_ISO-8859-15.txt | qprint -e)?=" +#ENCODED_MESSAGE="$(qprint -e ${LOCK_DIR}/message_tmp_ISO-8859-15.txt)" +#content_type='Content-Type: text/plain;\n charset="iso-8859-15"' +#transfer_encoding='Content-Transfer-Encoding: quoted-printable' +#content_disposition='Content-Disposition: inline' +# ===== # - Send E-Mail using UTF-8 Charset +# ===== + +# - Convert to UTF-8 # - iconv -t UTF8 -o ${LOCK_DIR}/subject_tmp_UTF8.txt ${LOCK_DIR}/subject_tmp.txt iconv -t UTF8 -o ${LOCK_DIR}/message_tmp_UTF8.txt ${LOCK_DIR}/message_tmp.txt + +# - encode base64 +# -- ENCODED_SUBJECT="=?utf-8?B?$(cat ${LOCK_DIR}/subject_tmp_UTF8.txt | base64 --wrap=0)?=" ENCODED_MESSAGE="$(cat ${LOCK_DIR}/message_tmp_UTF8.txt | base64)" content_type='Content-Type: text/plain;\n charset="utf-8"' +transfer_encoding='Content-Transfer-Encoding: base64' +content_disposition='Content-Disposition: inline' + +# - quoted-printable +# - +#ENCODED_SUBJECT="=?utf-8?Q?$(cat ${LOCK_DIR}/subject_tmp_UTF8.txt | qprint -e)?=" +#ENCODED_MESSAGE="$(qprint -e ${LOCK_DIR}/message_tmp_UTF8.txt)" +#content_type='Content-Type: text/plain;\n charset="utf-8"' +#transfer_encoding='Content-Transfer-Encoding: quoted-printable' +#content_disposition='Content-Disposition: inline' + # - If you know the Charset of the String variable 'SUBJECT' and 'MESSAGE', and @@ -264,10 +300,10 @@ content_type='Content-Type: text/plain;\n charset="utf-8"' #ENCODED_SUBJECT="=?utf-8?B?$(base64 --wrap=0 <<< "${SUBJECT}")?=" #ENCODED_MESSAGE="$(base64 <<< "${MESSAGE}")" #content_type='Content-Type: text/plain;\n charset="utf-8"' +#transfer_encoding='Content-Transfer-Encoding: base64' +#content_disposition='Content-Disposition: inline' -transfer_encoding='Content-Transfer-Encoding: base64' -content_disposition='Content-Disposition: inline' blank_line for EMAIL_TO in $EMAIL_ADDRESSES ; do