Re: [PATCH RFC 1/6] send-email: Add --delay for separating emails
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 9, 2009, 19:28 UTC
- Message-ID
- <7vskkh1va5.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <alpine.LFD.2.00.0904091342170.6741@xanadu.home>
Nicolas Pitre <nico@cam.org> writes:
Show 12 quoted lines
> On Thu, 9 Apr 2009, Jeff King wrote: > >> On Wed, Apr 08, 2009 at 09:25:25AM -0500, Michael Witten wrote: >> >> > Firstly, I presume that someone is electing to use this option, so it is >> > almost by definition not annoying for that person. >> >> Sure, obviously only people who enable it will be affected. I was >> thinking of it more in terms of group economics: how many people _will_ >> enable it, because they think the payoff outweighs the annoyance. > > My ISP doesn't allow me to send more than 20 emails at once.
Hmm, I first thought you meant 20 emails in a single smtp session, but it appears that we create a new instance of Net::SMTP for each piece of email so it really sounds like it is time based (N pieces of e-mail within M minutes).
Perhaps --pause=N,M to say "Pause N seconds for every M messages", where Michael's --delay=N is just a shorthand for --pause=N,1 is what you want? That is, reset the counter to 0 at the beginning, increment it after sending each message, and when the counter is M and if you have more to send, you wait for N seconds and reset the counter to 0. Then when you have a series smaller than 20 you won't have to suffer from any artificial delay.