git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Jim Meyering <jim@meyering.net>
Date
Mar 24, 2007, 19:58 UTC
Message-ID
<87slbu2z2l.fsf_-_@rho.meyering.net>
In-Reply-To
<200703241216.48177.andyparkins@gmail.com>

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@meyering.net>
---
 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
Previous: Andy Parkins
Message 10 of 10 in “hooks--update: new, required, config variable: hooks.envelopesender,”
  1. hooks--update: new, required, config variable: hooks.envelopesender,Jim Meyering, Mar 23, 2007
  2. Andy ParkinsMar 23, 2007
  3. Jim MeyeringMar 23, 2007
  4. Jakub NarebskiMar 23, 2007
  5. Andy ParkinsMar 23, 2007
  6. Jim MeyeringMar 23, 2007
  7. Andy ParkinsMar 23, 2007
  8. Jim MeyeringMar 24, 2007
  9. Andy ParkinsMar 24, 2007
  10. hooks--update: new, optional, config variable: hooks.envelopesenderJim Meyering, Mar 24, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.