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 17:09:13 -0400	[thread overview]
Message-ID: <20110414210913.GC6525@sigill.intra.peff.net> (raw)
In-Reply-To: <4DA754A4.3090709@windriver.com>

On Thu, Apr 14, 2011 at 04:10:12PM -0400, Paul Gortmaker wrote:

> The command line (git 1.7.4.4) is typically something like:
> 
> git send-email --to stable@kernel.org --to linux-kernel@vger.kernel.org \
>    --cc stable-review@kernel.org   some_patch_dir
> 
> So, let me get to what happened today:  After sending 113 out of 209
> patches, it came to the 114th patch, and gave me this:
> 
> (mbox) Adding cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> from line 'From: Dmitry Torokhov <dmitry.torokhov@gmail.com>'
> (body) Adding cc: Dmitry Torokhov <dtor@mail.ru> from line 'Signed-off-by: Dmitry Torokhov <dtor@mail.ru>'
> (body) Adding cc: Paul Gortmaker <paul.gortmaker@windriver.com> from line 'Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>'
> 5.2.1 <dtor@mail.ru>... Mailbox disabled for this recipient
> 
> Then, taking that as a hard error, it simply exited,
> leaving me scrambling to figure out how to quickly fix the
> offending patch and continue with the unsent queue.

I suspect part of the issue is that your mail setup is unlike that of
most people. Usually, we would deliver to some local MTA (either by SMTP
directly, by sendmail that speaks SMTP to a smarthost, or by sendmail
that queues directly); that MTA would queue the message in a spool for
you, and attempt delivery asynchronously.  So the errors generally come
all or nothing. You can queue mail, or you can't, and trying again and
again after each error is just wasteful and annoying. Eventual errors
are reported back to you as bounces.

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?

I can see in your case how it would be preferable to keep going through
the list and then assemble a set of errors at the end. But that should
be configurable, because most setups won't want that behavior.

>  From my point of view, the right thing to do here would have
> been to ignore the error on the harvested mail address, and continue
> on through the rest of the queue.

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".

Whether we can do better depends on your MTA. _If_ you are sending via
SMTP, and _if_ it will reject particular recipients at the time of "rcpt
to", then we could do something that clever. Given that the 5.2.1
message appeared on your terminal, and that it should not have been
generated by git-send-email, that implies to me you are using the local
sendmail binary.

> Or even interactively ask me what to do when it saw the 5.2.1 failure.
> But maybe that wouldn't be right for everyone.  I didn't see anything
> in the GSE man page that would let me configure this behaviour either.

The problem there is that the message probably was not actually sent (or
at least, sendmail presumably returned an error code to git, which is
why git stopped). And you, as a human, saw that the error was something
survivable. But you can't just tell git "it's OK to continue". You need
to actually fix the problem and re-send, which means telling git that
the one particular address is not interesting. And that is a lot more
interface than just yes/no.

I would think what you really want is a system that tries to send
everything, keeps track of which recipients are to receive which
message, and then marks success or failure for each. At the end, you
would find that dtor@mail.ru didn't receive anything, and realize you
don't care. And you don't have to worry about restarting a failed
send-email and sending duplicates. You know who got what.

If that sounds good, then you should consider switching MTAs, because
that is exactly what the job of an MTA is. :)

-Peff

  reply	other threads:[~2011-04-14 21:09 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 [this message]
2011-04-15  0:30   ` Paul Gortmaker
2011-04-15  3:42     ` Jeff King
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=20110414210913.GC6525@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).