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

Re: [PATCH v2] send-email: add an option to impose delay sent E-Mails

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Aug 14, 2018, 21:02 UTC
Message-ID
<87eff0hdaj.fsf@evledraar.gmail.com>
In-Reply-To
<20180814184509.GA16659@dcvr>
On Tue, Aug 14 2018, Eric Wong wrote:
Show 37 quoted lines
> Æ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).

Yeah that's a good point, maybe we're being wasteful on remote resources here.

> If the client sleeps, the server may disconnect the client anyways to
> save resources.
Seems like something we'd need to deal with anyway, do we?
Show 13 quoted lines
>> @@ -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

I need to enter a password when sending a batch with my SMTP server now, once. With relogin I'd need to enter this N times unless I use whatever auth save facility there is in git-send-email (which I don't use now).

I don't think it makes sense to conflate these two modes.
Previous: Junio C Hamano
Message 14 of 14 in “send-email: impose a delay while sending to appease GMail”
  1. 0/2 send-email: impose a delay while sending to appease GMailÆvar Arnfjörð Bjarmason, Mar 25, 2018
  2. 2/2 send-email: supply a --send-delay=1 by defaultÆvar Arnfjörð Bjarmason, Mar 25, 2018
  3. brian m. carlsonMar 25, 2018
  4. Ævar Arnfjörð BjarmasonMar 25, 2018
  5. Eric WongMar 28, 2018
  6. Junio C HamanoMar 26, 2018
  7. Eric SunshineMar 26, 2018
  8. Junio C HamanoMar 26, 2018
  9. 1/2 send-email: add an option to impose delay sent E-MailsÆvar Arnfjörð Bjarmason, Mar 25, 2018
  10. send-email: add an option to impose delay sent E-MailsÆvar Arnfjörð Bjarmason, Aug 14, 2018
  11. Stefan BellerAug 14, 2018
  12. Eric WongAug 14, 2018
  13. Junio C HamanoAug 14, 2018
  14. Ævar Arnfjörð BjarmasonAug 14, 2018

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.