Skip to content

Commit 4a55740

Browse files
authored
Merge pull request #2090 from oalbrigt/MailTo-add-s-nail-support-for-multiple-recipients
MailTo: add s-nail support for multiple recipients
2 parents 97d3c30 + 1e546b8 commit 4a55740

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

heartbeat/MailTo

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,16 @@ END
9292
}
9393

9494
MailProgram() {
95-
$MAILCMD -s "$1" "$email" <<EOF
96-
$Subject
97-
98-
Command line was:
99-
$ARGS
100-
EOF
95+
local body="\
96+
$Subject
97+
98+
Command line was:
99+
$ARGS"
100+
if $MAILCMD -V | grep -q "^s-nail"; then
101+
printf "$body" | $MAILCMD -s "$1" $(echo $email | sed "s/,\s*/ /g")
102+
else
103+
printf "$body" | $MAILCMD -s "$1" "$email"
104+
fi
101105
return $?
102106
}
103107

0 commit comments

Comments
 (0)