- my @x = (from => 'A', # Author
- subject => 'S', to => 'XTO', cc => 'XCC');
+ my @x = (from => 'A', to => 'XTO', cc => 'XCC'); # A: Author
+ while (my ($field, $pfx) = splice(@x, 0, 2)) {
+ my $val = $smsg->{$field};
+ next if $val eq '';
+ # include "(comments)" after the address, too, so not using
+ # PublicInbox::Address::names or pairs
+ index_text($self, $val, 1, $pfx);
+
+ # we need positional info for email addresses since they
+ # can be considered phrases
+ if ($self->{indexlevel} eq 'medium') {
+ for my $addr (PublicInbox::Address::emails($val)) {
+ index_phrase($self, $addr, 1, $pfx);
+ }
+ }
+ }
+ @x = (subject => 'S');