Use sendmail since mail/s-nail gets the mimetype of the email body wrong

This commit is contained in:
Trey Blancher 2023-08-19 13:15:53 -04:00
parent d3e6d66a3f
commit c22b59dc85

View File

@ -132,7 +132,7 @@ send () {
local psi="$(print_psi $(tr '[[:upper:]]' '[[:lower:]]' <<< ${psi_type}))"
local email=$(mktemp /tmp/psi.eml.XXXX)
local email=$(mktemp /tmp/psi.eml.XXXX.txt)
local subj
printf "Pressure Stall Information for ${host} triggered on ${psi_type} at $(date +'%FT%T %Z')\n\n" > ${email}
if [[ -n "${current_alarms}" ]]; then
@ -154,10 +154,12 @@ send () {
fi
# send the message
/usr/bin/mail -m ${email} --resource-files=/ \
--subject="${subj}" \
--end-options \
${dst}
(
printf "To: ${dst}\n"
printf "Subject: ${subj}\n"
cat ${email}
) | sendmail -t
#set +x
}