Skip to content

Commit 189dc26

Browse files
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 <[email protected]> Signed-off-by: Felix Schmidt <[email protected]> Closed #17238
1 parent 5ab6017 commit 189dc26

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cmd/zed/zed.d/zed-functions.sh

+5
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,11 @@ zed_notify_email()
283283
if [ "${ZED_EMAIL_OPTS%@SUBJECT@*}" = "${ZED_EMAIL_OPTS}" ] ; then
284284
# inject subject header
285285
printf "Subject: %s\n" "${subject}"
286+
# The following empty line is needed to separate the header from the
287+
# body of the message. Otherwise programs like sendmail will skip
288+
# everything up to the first empty line (or wont send an email at
289+
# all) and will still exit with exit code 0
290+
printf "\n"
286291
fi
287292
# output message
288293
cat "${pathname}"

0 commit comments

Comments
 (0)