Debugging cleanup improvements
The debug output is much more helpful if it has the parameters that were used. Pull the sendmail parameters into a seperate array for that, and also include similar data during the Net::SMTP case. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Robin H. Johnson committed
Apr 25, 2007 at 19:37 UTC
8e3d436b0b5148bac11259bac55621e285eeb6c4
1 file changed
+6
-4
git-send-email.perl
+6
-4
@@ -465,15 +465,15 @@ X-Mailer: git-send-email $gitversion
465
$header .= join("\n", @xh) . "\n";
466
}
467
468
+ my @sendmail_parameters = ('-i', map { extract_valid_address($_) } @recipients);
469
+
470
if ($dry_run) {
471
# We don't want to send the email.
472
} elsif ($smtp_server =~ m#^/#) {
473
my $pid = open my $sm, '|-';
474
defined $pid or die $!;
475
if (!$pid) {
474
- exec($smtp_server,'-i',
475
- map { extract_valid_address($_) }
476
- @recipients) or die $!;
476
+ exec($smtp_server, @sendmail_parameters) or die $!;
477
}
478
print $sm "$header\n$message";
479
close $sm or die $?;
@@ -493,8 +493,10 @@ X-Mailer: git-send-email $gitversion
493
print (($dry_run ? "Dry-" : "")."OK. Log says:\nDate: $date\n");
494
if ($smtp) {
495
print "Server: $smtp_server\n";
496
+ print "MAIL FROM: $from\n";
497
+ print "RCPT TO: ".join(',',@recipients)."\n";
498
} else {
497
- print "Sendmail: $smtp_server\n";
499
+ print "Sendmail: $smtp_server ".join(' ',@sendmail_parameters)."\n";
500
}
501
print "From: $from\nSubject: $subject\nCc: $cc\nTo: $to\n\n";
502
if ($smtp) {