# [PATCH] hooks/post-receive-email: do not truncate messages at a '.' line

2 messages from 2014-07-17 to 2014-07-17. Participants: Kyle J. McKay, Junio C Hamano.
Thread: https://gitlist.dev/t/37151

## Kyle J. McKay, 2014-07-17 19:26

Subject: [PATCH] hooks/post-receive-email: do not truncate messages at a '.' line
Message-ID: <53b2ad7801889b49f04cb0ae7b0b37b@74d39fa044aa309eaea14b9f57fe79c>
URL: https://gitlist.dev/e/53b2ad7801889b49f04cb0ae7b0b37b%4074d39fa044aa309eaea14b9f57fe79c

```
When sendmail is reading an incoming message, by default it will
terminate it if it reads a dot on a line by itself.

The post-receive-email script can generate such a line if the
message in a tag object contains a dot ('.') on a line by itself.

There are two options to turn off this behavior, -i and -oi which
are equivalent.

The choice of which to use is based on the observation that -i
appears to be the more commonly used option for this and that all
current sendmail-compatible programs appear to accept both.

Therefore add the -i option to the invocations of /usr/sbin/sendmail
to avoid prematurely terminating the input message at the occurence
of a dot ('.') on a line by itself.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
---

BTW, what is the status of post-receive-email?

I find it quite useful for a minimal server that only needs Git
binaries and a POSIX shell.

The only real issue with it I'm aware of is that if multiple
branch heads are updated in a single push and two or more
contain the same new revison(s), those revision(s) will be
incorrectly omitted from the emails sent out.

I have a patch to correct that, but it's not quite as simple
as this patch and would need more review, so I don't really
want to send it out and waste folks' time if there's no interest
in picking up updates to contrib/hooks/post-receive-email.

 contrib/hooks/post-receive-email | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/hooks/post-receive-email b/contrib/hooks/post-receive-email
index 8747b843..6207be60 100755
--- a/contrib/hooks/post-receive-email
+++ b/contrib/hooks/post-receive-email
@@ -704,9 +704,9 @@ limit_lines()
 send_mail()
 {
 	if [ -n "$envelopesender" ]; then
-		/usr/sbin/sendmail -t -f "$envelopesender"
+		/usr/sbin/sendmail -i -t -f "$envelopesender"
 	else
-		/usr/sbin/sendmail -t
+		/usr/sbin/sendmail -i -t
 	fi
 }
 
-- 
1.8.5

```

## Junio C Hamano, 2014-07-17 19:36

Subject: Re: [PATCH] hooks/post-receive-email: do not truncate messages at a '.' line
Message-ID: <xmqq38dzpykx.fsf@gitster.dls.corp.google.com>
URL: https://gitlist.dev/e/xmqq38dzpykx.fsf%40gitster.dls.corp.google.com
In-Reply-To: <53b2ad7801889b49f04cb0ae7b0b37b@74d39fa044aa309eaea14b9f57fe79c>

```
"Kyle J. McKay" <mackyle@gmail.com> writes:

> There are two options to turn off this behavior, -i and -oi which
> are equivalent.
>
> The choice of which to use is based on the observation that -i
> appears to be the more commonly used option for this and that all
> current sendmail-compatible programs appear to accept both.

OK; I suspect some just accept but ignore, though.

> BTW, what is the status of post-receive-email?

I do not use either, but some people seem to consider multimail its
successor, so enhancements may have a wider audience there.

```
