From: Eric Wong Date: Mon, 28 Oct 2019 10:45:15 +0000 (+0000) Subject: learn: support multiple To/Cc headers X-Git-Tag: v1.2.0~14^2~12 X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=commitdiff_plain;h=83470f5e60e44d7f70b378f4b250c6584f42f64e learn: support multiple To/Cc headers It's possible to specify these headers multiple times, and PublicInbox::MDA->precheck takes that into account, so -learn should, too. --- diff --git a/script/public-inbox-learn b/script/public-inbox-learn index c4c4d4b9..8ff1652b 100755 --- a/script/public-inbox-learn +++ b/script/public-inbox-learn @@ -42,9 +42,11 @@ my $mime = PublicInbox::MIME->new(eval { # get all recipients my %dests; foreach my $h (qw(Cc To)) { - my $val = $mime->header($h) or next; - foreach my $email (PublicInbox::Address::emails($val)) { - $dests{lc($email)} = 1; + my @val = $mime->header($h) or next; + for (@val) { + foreach my $email (PublicInbox::Address::emails($_)) { + $dests{lc($email)} = 1; + } } }