lib/PublicInbox/View.pm | 18 +++++++++++++++--- diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 9fa2a9bdf97c50500d1835d599a73007ce1978f0..d906276a63e8f27e49c45d64a7eff3fcbe8c73d5 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -83,6 +83,12 @@ } undef; } +sub _hdr_names ($$) { + my ($hdr, $field) = @_; + my $val = $hdr->header($field) or return ''; + ascii_html(join(', ', PublicInbox::Address::names($val))); +} + # this is already inside a
 sub index_entry {
 	my ($mime, $level, $state) = @_;
@@ -98,7 +104,6 @@ 	my $seen = $state->{seen};
 	$seen->{$id} = "#$id"; # save the anchor for children, later
 
 	my $mid = PublicInbox::Hval->new_msgid($mid_raw);
-	my $from = PublicInbox::Address::from_name($hdr->header('From'));
 
 	my $root_anchor = $state->{root_anchor} || '';
 	my $path = $root_anchor ? '../../' : '';
@@ -106,7 +111,6 @@ 	my $href = $mid->as_href;
 	my $irt = in_reply_to($hdr);
 	my $parent_anchor = $seen->{anchor_for($irt)} if defined $irt;
 
-	$from = ascii_html($from);
 	$subj = ascii_html($subj);
 	$subj = "$subj";
 	$subj = "$subj" if $root_anchor eq $id;
@@ -116,7 +120,15 @@ 	my $rv = "";
 	$rv .= "$subj\n";
 	my $txt = "${path}$href/raw";
 	my $fh = $state->{fh};
-	$fh->write($rv .= "- $from @ $ts UTC (raw)\n\n");
+	my $from = _hdr_names($hdr, 'From');
+	$rv .= "- $from @ $ts UTC (raw)\n";
+	my @tocc;
+	foreach my $f (qw(To Cc)) {
+		my $dst = _hdr_names($hdr, $f);
+		push @tocc, "$f: $dst" if $dst ne '';
+	}
+	$rv .= '  '.join('; +', @tocc) . "\n" if @tocc;
+	$fh->write($rv .= "\n");
 
 	my $mhref = "${path}$href/";