Merge branch 'jp/maint-send-email-fold'
authorJunio C Hamano <gitster@pobox.com>
Mon, 19 Oct 2009 06:01:37 +0000 (23:01 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 19 Oct 2009 06:01:37 +0000 (23:01 -0700)
* jp/maint-send-email-fold:
git-send-email.perl: fold multiple entry "Cc:" and multiple single line "RCPT TO:"s

1  2 
git-send-email.perl
diff --combined git-send-email.perl
index f5ba4e7699936499021a8a955b198668b98a1696,e188a894950fb0ab586d1ee12cc54c0691329faa..a0279de687064c762a4ee24dfe2ed1922afab53a
@@@ -401,7 -401,7 +401,7 @@@ my %aliases
  my %parse_alias = (
        # multiline formats can be supported in the future
        mutt => sub { my $fh = shift; while (<$fh>) {
 -              if (/^\s*alias\s+(\S+)\s+(.*)$/) {
 +              if (/^\s*alias\s+(?:-group\s+\S+\s+)*(\S+)\s+(.*)$/) {
                        my ($alias, $addr) = ($1, $2);
                        $addr =~ s/#.*$//; # mutt allows # comments
                         # commas delimit multiple addresses
@@@ -835,7 -835,7 +835,7 @@@ sub send_messag
            $gitversion = Git::version();
        }
  
-       my $cc = join(", ", unique_email_list(@cc));
+       my $cc = join(",\n\t", unique_email_list(@cc));
        my $ccline = "";
        if ($cc ne '') {
                $ccline = "\nCc: $cc";
@@@ -921,7 -921,7 +921,7 @@@ X-Mailer: git-send-email $gitversio
                        $smtp ||= Net::SMTP->new((defined $smtp_server_port)
                                                 ? "$smtp_server:$smtp_server_port"
                                                 : $smtp_server);
 -                      if ($smtp_encryption eq 'tls') {
 +                      if ($smtp_encryption eq 'tls' && $smtp) {
                                require Net::SMTP::SSL;
                                $smtp->command('STARTTLS');
                                $smtp->response();
                if ($smtp_server !~ m#^/#) {
                        print "Server: $smtp_server\n";
                        print "MAIL FROM:<$raw_from>\n";
-                       print "RCPT TO:".join(',',(map { "<$_>" } @recipients))."\n";
+                       foreach my $entry (@recipients) {
+                           print "RCPT TO:<$entry>\n";
+                       }
                } else {
                        print "Sendmail: $smtp_server ".join(' ',@sendmail_parameters)."\n";
                }