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

Re: Issues with git send-email and msmtp

From
EWEric Wong <e@80x24.org>
Date
Mar 21, 2017, 19:23 UTC
Message-ID
<20170321192313.GA15269@whir>
In-Reply-To
<20170321165004.fvhzuu3otv4nmh4j@sigill.intra.peff.net>
Jeff King <peff@peff.net> wrote:
Show 12 quoted lines
> 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.
Hi Roger, can you also enable msmtp logging and debugging?

logfile /path/to/log # in ~/.msmtprc And "msmtp --debug" in the command line

Show 17 quoted lines
> 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";
Perhaps also:
		print $sm "$header\n$message" or
				die "print failed to $smtp_server: $!";
> -		close $sm or die $!;
> +		if (!close($sm)) {
> +			die $! ? "unable to write to $smtp_server: $!"
> +			       : "smtp program '$smtp_server' exited non-zero: $?"
Parentheses please :>
Previous: Jeff KingNext: Roger Pau Monné
Message 3 of 4 in “Issues with git send-email and msmtp”
  1. Roger Pau MonnéMar 21, 2017
  2. Jeff KingMar 21, 2017
  3. Eric WongMar 21, 2017
  4. Roger Pau MonnéMar 22, 2017

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.