send-email: try to order messages in email clients more correctly
If --no-chain-reply-to is set, patches may not always be ordered correctly in email clients. This patch makes sure each email sent from a different second. I chose to start with a time (slightly) in the past because those are probably more likely in real-world usage and spam filters might be more tolerant of them. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
Eric Wong committed
Mar 25, 2006 at 03:01 UTC
a5370b16c34993c1d0f65171d5704244901e005b
1 file changed
+3
-2
git-send-email.perl
+3
-2
@@ -37,7 +37,7 @@ sub cleanup_compose_files();
37
my $compose_filename = ".msg.$$";
38
39
# Variables we fill in automatically, or via prompting:
40
-my (@to,@cc,@initial_cc,$initial_reply_to,$initial_subject,@files,$from,$compose);
40
+my (@to,@cc,@initial_cc,$initial_reply_to,$initial_subject,@files,$from,$compose,$time);
41
42
# Behavior modification variables
43
my ($chain_reply_to, $smtp_server, $quiet, $suppress_from, $no_signed_off_cc) = (1, "localhost", 0, 0, 0);
@@ -273,13 +273,14 @@ sub make_message_id
273
274
275
$cc = "";
276
+$time = time - scalar $#files;
277
278
sub send_message
279
{
280
my @recipients = unique_email_list(@to);
281
my $to = join (",\n\t", @recipients);
282
@recipients = unique_email_list(@recipients,@cc);
282
- my $date = strftime('%a, %d %b %Y %H:%M:%S %z', localtime(time));
283
+ my $date = strftime('%a, %d %b %Y %H:%M:%S %z', localtime($time++));
284
285
my $header = "From: $from
286
To: $to