reminder_email.sh: add support for quoted-printable.

This commit is contained in:
Christoph 2019-07-04 18:38:44 +02:00
parent bd18345293
commit acaa968748

View File

@ -240,22 +240,58 @@ fi
echo "$MESSAGE" > ${LOCK_DIR}/message_tmp.txt echo "$MESSAGE" > ${LOCK_DIR}/message_tmp.txt
echo "$SUBJECT" > ${LOCK_DIR}/subject_tmp.txt echo "$SUBJECT" > ${LOCK_DIR}/subject_tmp.txt
# =====
# - Send E-Mail using ISO-8859-15 Charset # - 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}/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 #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_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"' #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 # - 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}/subject_tmp_UTF8.txt ${LOCK_DIR}/subject_tmp.txt
iconv -t UTF8 -o ${LOCK_DIR}/message_tmp_UTF8.txt ${LOCK_DIR}/message_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_SUBJECT="=?utf-8?B?$(cat ${LOCK_DIR}/subject_tmp_UTF8.txt | base64 --wrap=0)?="
ENCODED_MESSAGE="$(cat ${LOCK_DIR}/message_tmp_UTF8.txt | base64)" ENCODED_MESSAGE="$(cat ${LOCK_DIR}/message_tmp_UTF8.txt | base64)"
content_type='Content-Type: text/plain;\n charset="utf-8"' 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 # - 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_SUBJECT="=?utf-8?B?$(base64 --wrap=0 <<< "${SUBJECT}")?="
#ENCODED_MESSAGE="$(base64 <<< "${MESSAGE}")" #ENCODED_MESSAGE="$(base64 <<< "${MESSAGE}")"
#content_type='Content-Type: text/plain;\n charset="utf-8"' #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 blank_line
for EMAIL_TO in $EMAIL_ADDRESSES ; do for EMAIL_TO in $EMAIL_ADDRESSES ; do