From c22b59dc85ab9b62f7e440c7f57acce3c861f170 Mon Sep 17 00:00:00 2001 From: Trey Blancher Date: Sat, 19 Aug 2023 13:15:53 -0400 Subject: [PATCH] Use sendmail since mail/s-nail gets the mimetype of the email body wrong --- psi-alerts.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/psi-alerts.sh b/psi-alerts.sh index c4f2a7e..17b8fc4 100755 --- a/psi-alerts.sh +++ b/psi-alerts.sh @@ -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 }