mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-05-23 15:04:59 +03:00
Fixed zfs_notify_email for programs like sendmail
zfs_notify_email will now include an empty line separating the header from the body of the email in case the subject is not provided via a command line argument. This is necessary for programs like sendmail to function correctly (everything up to the first empty line is interpreted as header, which previously resulted in either missing message parts or unsent emails) Reviewed-by: Alexander Motin <mav@FreeBSD.org> Signed-off-by: Felix Schmidt <felixschmidt20@aol.com> Closed #17238
This commit is contained in:
parent
5ab601771c
commit
189dc26296
@ -283,6 +283,11 @@ zed_notify_email()
|
|||||||
if [ "${ZED_EMAIL_OPTS%@SUBJECT@*}" = "${ZED_EMAIL_OPTS}" ] ; then
|
if [ "${ZED_EMAIL_OPTS%@SUBJECT@*}" = "${ZED_EMAIL_OPTS}" ] ; then
|
||||||
# inject subject header
|
# inject subject header
|
||||||
printf "Subject: %s\n" "${subject}"
|
printf "Subject: %s\n" "${subject}"
|
||||||
|
# The following empty line is needed to separate the header from the
|
||||||
|
# body of the message. Otherwise programs like sendmail will skip
|
||||||
|
# everything up to the first empty line (or wont send an email at
|
||||||
|
# all) and will still exit with exit code 0
|
||||||
|
printf "\n"
|
||||||
fi
|
fi
|
||||||
# output message
|
# output message
|
||||||
cat "${pathname}"
|
cat "${pathname}"
|
||||||
|
Loading…
Reference in New Issue
Block a user