# --- 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
hooks/post-receive
- --
+ --
$projectdesc
EOF
}
echo $LOGEND
}
+send_mail()
+{
+ if [ -n "$envelopesender" ]; then
+ /usr/sbin/sendmail -t -f "$envelopesender"
+ else
+ /usr/sbin/sendmail -t
+ fi
+}
+
# ---------------------------- main()
# --- Constants
# 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