From: Eric Wong <e@80x24.org>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
"brian m . carlson" <sandals@crustytoothpaste.net>,
Eric Sunshine <sunshine@sunshineco.com>
Subject: Re: [PATCH v2] send-email: add an option to impose delay sent E-Mails
Date: Tue, 14 Aug 2018 18:45:09 +0000 [thread overview]
Message-ID: <20180814184509.GA16659@dcvr> (raw)
In-Reply-To: <20180814181534.21234-1-avarab@gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
> Add a --send-delay option with a corresponding sendemail.smtpSendDelay
> configuration variable. When set to e.g. 2, this causes send-email to
> sleep 2 seconds before sending the next E-Mail. We'll only sleep
> between sends, not before the first send, or after the last.
>
> This option has two uses. Firstly, to be able to Ctrl+C a long send
> with "all" if you have a change of heart. Secondly, as a hack in some
> mail setups to, with a sufficiently high delay, force the receiving
> client to sort the E-Mails correctly.
>
> Some popular E-Mail clients completely ignore the "Date" header, which
> format-patch is careful to set such that the patches will be displayed
> in order, and instead sort by the time the E-mail was received.
>
> Google's GMail is a good example of such a client. It ostensibly sorts
> by some approximation of received time (although not by any "Received"
> header). It's more usual than not to see patches showing out of order
> in GMail. To take a few examples of orders seen on patches on the Git
> mailing list:
>
> 1 -> 3 -> 4 -> 2 -> 8 -> 7 (completion by Nguyễn Thái Ngọc Duy)
> 2 -> 0 -> 1 -> 3 (pack search by Derrick Stolee)
> 3 -> 2 -> 1 (fast-import by Jameson Miller)
> 2 -> 3 -> 1 -> 5 -> 4 -> 6 (diff-highlight by Jeff King)
>
> The reason to add the new "X-Mailer-Send-Delay" header is to make it
> easy to tell what the imposed delay was, if any. This allows for
> gathering some data on how the transfer of E-Mails with & without this
> option behaves. This may not be workable without really long delays,
> see [1] and [2].
Aside from the new header, I think this is better implemented
using the existing $relogin_delay and $batch_size=1.
Disconnecting during the delay might be more sympathetic to
existing mail servers (which aren't C10K-optimized). If the
client sleeps, the server may disconnect the client anyways
to save resources.
> @@ -1741,6 +1747,10 @@ sub process_file {
> $message, $xfer_encoding, $target_xfer_encoding);
> push @xh, "Content-Transfer-Encoding: $xfer_encoding";
> unshift @xh, 'MIME-Version: 1.0' unless $has_mime_version;
> + if ($send_delay && $i > 0) {
> + push @xh, "X-Mailer-Send-Delay: $send_delay";
> + sleep $send_delay;
> + }
We can add this header for relogin_delay + batch_size
But maybe --send-delay can be a shortcut for
--relogin-delay and --batch-size=1
next prev parent reply other threads:[~2018-08-14 18:45 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-25 18:28 [PATCH 0/2] send-email: impose a delay while sending to appease GMail Ævar Arnfjörð Bjarmason
2018-03-25 18:28 ` [PATCH 1/2] send-email: add an option to impose delay sent E-Mails Ævar Arnfjörð Bjarmason
2018-03-25 18:28 ` [PATCH 2/2] send-email: supply a --send-delay=1 by default Ævar Arnfjörð Bjarmason
2018-03-25 21:01 ` brian m. carlson
2018-03-25 22:01 ` Ævar Arnfjörð Bjarmason
2018-03-28 1:26 ` Eric Wong
2018-03-26 1:48 ` Junio C Hamano
2018-03-26 0:11 ` Eric Sunshine
2018-03-26 1:56 ` Junio C Hamano
2018-08-14 18:15 ` [PATCH v2] send-email: add an option to impose delay sent E-Mails Ævar Arnfjörð Bjarmason
2018-08-14 18:39 ` Stefan Beller
2018-08-14 18:45 ` Eric Wong [this message]
2018-08-14 19:53 ` Junio C Hamano
2018-08-14 21:02 ` Ævar Arnfjörð Bjarmason
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=20180814184509.GA16659@dcvr \
--to=e@80x24.org \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=sandals@crustytoothpaste.net \
--cc=sunshine@sunshineco.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).