From: Jim Meyering <jim@meyering.net>
To: git@vger.kernel.org
Subject: [PATCH] hooks--update: new, required, config variable: hooks.envelopesender,
Date: Fri, 23 Mar 2007 13:11:02 +0100 [thread overview]
Message-ID: <874poc88ix.fsf@rho.meyering.net> (raw)
This change adds a new, required, config variable: hooks.envelopesender,
and use that with sendmail's -f option. This is important in order
to avoid relying on sendmail's "guess" at an appropriate envelope
sender address. Without this, and in the presence of strict servers,
it is far too easy not ever to be notified, or (more insidious) never
to receive bounce email.
Below, I've included an additional patch in case you want
to require the envelopesender setting only when at least one of the
mailing list variables is set.
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 8f6c4fe..bc1f1a9 100644
--- a/templates/hooks--update
+++ b/templates/hooks--update
@@ -12,6 +12,10 @@
# 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 should be a useful
+# email address within your organization. Required.
# 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 +56,16 @@ 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 [ -z "$envelope_sender" ]; then
+ echo "Usage: hooks.envelopesender must be set in config" >&2
+ exit 1
+fi
+
# --- Check types
newrev_type=$(git-cat-file -t $newrev)
@@ -279,7 +289,7 @@ $0 $1 \\
$3
EOF
#) | cat >&2
-) | /usr/sbin/sendmail -t
+) | /usr/sbin/sendmail -f "$envelope_sender" -t
# --- Finished
exit 0
--
1.5.1.rc1
>From 4b3d42890b2b33b2f34902d26561b78e5e92ddba Mon Sep 17 00:00:00 2001
From: Jim Meyering <jim@meyering.net>
Date: Fri, 23 Mar 2007 13:06:00 +0100
Subject: [PATCH] Fail upon undefined envelopesender only if at least one of
the mailing list variables is set.
Signed-off-by: Jim Meyering <jim@meyering.net>
---
templates/hooks--update | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/templates/hooks--update b/templates/hooks--update
index bc1f1a9..c79b4b4 100644
--- a/templates/hooks--update
+++ b/templates/hooks--update
@@ -61,9 +61,11 @@ recipients=$(git-repo-config hooks.mailinglist)
announcerecipients=$(git-repo-config hooks.announcelist)
allowunannotated=$(git-repo-config --bool hooks.allowunannotated)
-if [ -z "$envelope_sender" ]; then
- echo "Usage: hooks.envelopesender must be set in config" >&2
- exit 1
+if [ -n "$recipients$announcerecipients" ]; then
+ if [ -z "$envelope_sender" ]; then
+ echo "Usage: hooks.envelopesender must be set in config" >&2
+ exit 1
+ fi
fi
# --- Check types
--
1.5.1.rc1
next reply other threads:[~2007-03-23 12:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-23 12:11 Jim Meyering [this message]
2007-03-23 12:58 ` [PATCH] hooks--update: new, required, config variable: hooks.envelopesender, Andy Parkins
2007-03-23 13:29 ` Jim Meyering
2007-03-23 14:05 ` Jakub Narebski
2007-03-23 14:12 ` Andy Parkins
2007-03-23 15:25 ` Jim Meyering
2007-03-23 16:15 ` Andy Parkins
2007-03-24 11:27 ` Jim Meyering
2007-03-24 12:16 ` Andy Parkins
2007-03-24 19:58 ` [PATCH] hooks--update: new, optional, config variable: hooks.envelopesender Jim Meyering
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874poc88ix.fsf@rho.meyering.net \
--to=jim@meyering.net \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.