diff options
author | Jim Meyering <jim@meyering.net> | 2007-09-25 08:48:59 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-09-25 00:30:19 -0700 |
commit | d1637a07f684acd80007723f94c4da9649d85525 (patch) | |
tree | 32d9301371880527a4dee3a146be24f99eacdc33 /contrib | |
parent | e883932f7dc83ea69a990cba656464d5315f3300 (diff) | |
download | git-d1637a07f684acd80007723f94c4da9649d85525.tar.gz git-d1637a07f684acd80007723f94c4da9649d85525.tar.xz |
Do not over-quote the -f envelopesender value.
Without this, the value passed to sendmail would have an extra set of
single quotes. At least exim's sendmail emulation would object to that:
exim: bad -f address "'list-addr@example.org'": malformed address: ' \
may not follow 'list-addr@example.org
error: hooks/post-receive exited with error code 1
Signed-off-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/hooks/post-receive-email | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/contrib/hooks/post-receive-email b/contrib/hooks/post-receive-email index c589a39a0..1f88099df 100644 --- a/contrib/hooks/post-receive-email +++ b/contrib/hooks/post-receive-email @@ -571,6 +571,15 @@ generate_delete_general_email() echo $LOGEND } +send_mail() +{ + if [ -n "$envelopesender" ]; then + /usr/sbin/sendmail -t -f "$envelopesender" + else + /usr/sbin/sendmail -t + fi +} + # ---------------------------- main() # --- Constants @@ -607,13 +616,8 @@ if [ -n "$1" -a -n "$2" -a -n "$3" ]; then # resend an email; they could redirect the output to sendmail themselves PAGER= generate_email $2 $3 $1 else - if [ -n "$envelopesender" ]; then - envelopesender="-f '$envelopesender'" - fi - while read oldrev newrev refname do - generate_email $oldrev $newrev $refname | - /usr/sbin/sendmail -t $envelopesender + generate_email $oldrev $newrev $refname | send_mail done fi |