From 83470f5e60e44d7f70b378f4b250c6584f42f64e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 28 Oct 2019 10:45:15 +0000 Subject: 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. --- script/public-inbox-learn | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'script/public-inbox-learn') 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; + } } } -- cgit v1.2.3-24-ge0c7