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(-)
Show changes to contrib/hooks/post-receive-email +2 −2
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