[PATCH] hooks--update: new, optional, config variable: hooks.envelopesender

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This change adds a new, optional, config variable: hooks.envelopesender.
When set, the "update" hook uses its value with sendmail's -f option.

Signed-off-by: Jim Meyering <jim@xxxxxxxxxxxx>
---
 templates/hooks--update |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/templates/hooks--update b/templates/hooks--update
index 1a60773..02e2494 100644
--- a/templates/hooks--update
+++ b/templates/hooks--update
@@ -12,6 +12,11 @@
 #   This is the list that all pushes will go to; leave it blank to not send
 #   emails frequently.  The log email will list every log entry in full between
 #   the old ref value and the new ref value.
+# hooks.envelopesender
+#   Use this email address as the envelope sender (argument to sendmail's
+#   -f option).  This is not the "From:" address.  This can be useful to
+#   ensure that all delivery problem notifications go to the same, known-
+#   working address.
 # hooks.announcelist
 #   This is the list that all pushes of annotated tags will go to.  Leave it
 #   blank to just use the mailinglist field.  The announce emails list the
@@ -52,10 +57,15 @@ fi

 # --- Config
 projectdesc=$(cat $GIT_DIR/description)
+envelope_sender=$(git-repo-config hooks.envelopesender)
 recipients=$(git-repo-config hooks.mailinglist)
 announcerecipients=$(git-repo-config hooks.announcelist)
 allowunannotated=$(git-repo-config --bool hooks.allowunannotated)

+if [ -n "$envelope_sender" ]; then
+	envelope_sender_option="-f '$envelope_sender'"
+fi
+
 # check for no description
 if [ -z "$projectdesc" -o "$projectdesc" = "Unnamed repository; edit this file to name it for gitweb" ]; then
 	echo "*** Project description file hasn't been set" >&2
@@ -285,7 +295,7 @@ $0 $1 \\
   $3
 EOF
 #) | cat >&2
-) | /usr/sbin/sendmail -t
+) | eval /usr/sbin/sendmail $envelope_sender_option -t

 # --- Finished
 exit 0
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]