git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: "Roger Pau Monné" <royger@FreeBSD.org>
Cc: git@vger.kernel.org
Subject: Re: Issues with git send-email and msmtp
Date: Tue, 21 Mar 2017 12:50:05 -0400	[thread overview]
Message-ID: <20170321165004.fvhzuu3otv4nmh4j@sigill.intra.peff.net> (raw)
In-Reply-To: <20170321154921.3jgn4ktcop4shct2@dhcp-3-128.uk.xensource.com>

On Tue, Mar 21, 2017 at 03:49:21PM +0000, Roger Pau Monné wrote:

> I'm trying to use git send-email with msmtp, and I have added the following to
> my .gitconfig:
> 
> [sendemail]
> 	smtpserver = "/usr/local/bin/msmtp"
> 
> This seems to work fine, except that sometimes git dies unexpectedly after
> queuing a patch to msmtp:
> 
> Died at /usr/local/Cellar/git/2.12.0/libexec/git-core/git-send-email line 1350, <FIN> line 3.

That line looks like it's the "close" on the pipe. If it's dying racily
that could mean that msmtp for some reason is not eating all of the
data and we're getting EPIPE (though that seems weird, since we're just
dumping the message until EOF). Or possibly msmtp is sometimes exiting
non-zero.

Capturing an "strace" for a failing run would be helpful. If that's not
possible, something like this patch might help diagnose it:

diff --git a/git-send-email.perl b/git-send-email.perl
index eea0a517f..32d34f995 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -1346,7 +1346,10 @@ EOF
 			exec($smtp_server, @sendmail_parameters) or die $!;
 		}
 		print $sm "$header\n$message";
-		close $sm or die $!;
+		if (!close($sm)) {
+			die $! ? "unable to write to $smtp_server: $!"
+			       : "smtp program '$smtp_server' exited non-zero: $?"
+		}
 	} else {
 
 		if (!defined $smtp_server) {

  reply	other threads:[~2017-03-21 16:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-21 15:49 Issues with git send-email and msmtp Roger Pau Monné
2017-03-21 16:50 ` Jeff King [this message]
2017-03-21 19:23   ` Eric Wong
2017-03-22  9:47 ` Roger Pau Monné

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170321165004.fvhzuu3otv4nmh4j@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=royger@FreeBSD.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).