git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: git@vger.kernel.org
Subject: Re: RFC: git send-email and error handling
Date: Thu, 14 Apr 2011 23:42:51 -0400	[thread overview]
Message-ID: <20110415034251.GC19621@sigill.intra.peff.net> (raw)
In-Reply-To: <4DA791A2.3010901@windriver.com>

On Thu, Apr 14, 2011 at 08:30:26PM -0400, Paul Gortmaker wrote:

> > Your setup seems different; it looks like your sendmail (or the SMTP
> > server you connect to) actually routes the mail without queueing at all,
> > and you synchronously get the final word on whether it can be delivered.
> > Or maybe it just connects to the recipient site and checks that "RCPT
> > TO" works before actually queueing. It's hard to say from the snippet
> > above. What's your MTA?
> 
> Yes, the above is true -- I'm not queuing anything locally or involving
> a local MTA.  I've set sendemail.smtpserver in my ~/.gitconfig to the
> hostname of an infrastructural server running sendmail (telnet 25 doesnt
> show me what version, but I'm told it is sendmail).

Ah. I'm not up on my sendmail config, but googling around, there are
apparently milters that will do this kind of "call-ahead" rcpt checking.

> This configuration gives me the most portability to run on any random
> machine within our org without having to wonder if it has a locally
> installed and correctly configured MTA -- it works so well, I've even
> abused git send-email to dispatch random (non-patch) mails from ad-hoc
> scripts on occasions, simply because I know everyone has git installed
> somewhere in $PATH.

Yeah, I think submitting to a central server is a very sane config if
you don't have reliably local delivery.

> > It's a little tricky, because send-email may not know the details of
> > what happened, especially if this behavior comes from a sendmail
> > wrapper rather than SMTP. We dump the message and a list of recipients
> > to an external program, and then get back a "yes it was sent" or "no it
> > was not" code. So we can't do anything clever, like say "Well, it was
> > sent, but not to one particular address, but that's OK because that
> > address was auto-harvested from a signed-off-by line".
> 
> True.  I wonder if there is some flexibility in what we do, depending
> on whether the setting is a local binary like /usr/bin/sendmail, vs.
> a hostname of a server, like it was in my case...

Sure. Since you are actually doing SMTP, you have much more flexibility
in knowing what errors happen. Look in git-send-email.perl's
send_message, around line 1118. We use the Mail::SMTP module, but we
just feed it the whole recipient list and barf if any of them is
rejected. You could probably remember which recipients are "important"
(i.e., given on the command line) and which were pulled automatically
from the commit information, and then feed each recipient individually.
If important ones fail, abort the message. If an unimportant one fails,
send the message anyway, but remember the bad address and report the
error at the end.

That wouldn't help people using a sendmail binary, but there's nothing
we can do. That transport simply doesn't supply as much information, so
it can't take advantage of the new feature. But it will be no worse off
for you adding the feature for SMTP users.

-Peff

  reply	other threads:[~2011-04-15  3:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-14 20:10 RFC: git send-email and error handling Paul Gortmaker
2011-04-14 21:09 ` Jeff King
2011-04-15  0:30   ` Paul Gortmaker
2011-04-15  3:42     ` Jeff King [this message]
2011-05-04 16:12     ` [RFC/PATCH] git-send-email: Remember sources of Cc addresses Jakub Narebski
2011-05-04 21:35       ` Jeff King
2011-05-05 14:01         ` [RFC/PATCH 2/2] git-send-email: Do not require that addresses added from body be valid Jakub Narebski
2011-05-06 11:22           ` [RFC/PATCH 3/2 (squash!)] git-send-email: Warn about rejected automatically added recipients Jakub Narebski
2011-05-07 13:21           ` [RFC/PATCH 2/2] git-send-email: Do not require that addresses added from body be valid Jakub Narebski

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=20110415034251.GC19621@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=paul.gortmaker@windriver.com \
    /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 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 NNTP newsgroup(s).