Merge branch 'je/hooks'
[gitweb.git] / contrib / hooks / post-receive-email
index c589a39a0c81818150575c74866a57619e1adf2a..cbbd02fadd753215b3477c178b74d79a59424ee7 100644 (file)
@@ -177,7 +177,6 @@ generate_email_header()
        # --- Email (all stdout will be the email)
        # Generate header
        cat <<-EOF
-       From: $committer
        To: $recipients
        Subject: ${EMAILPREFIX}$projectdesc $refname_type, $short_refname, ${change_type}d. $describe
        X-Git-Refname: $refname
@@ -571,6 +570,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 +615,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