From 74a3206babe0572a1494500d21267a31873af7b0 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 28 Oct 2019 10:45:26 +0000 Subject: mda: support multiple List-ID matches While it's not RFC2919-conformant, mail software can theoretically set multiple List-ID headers. Deliver to all inboxes which match a given List-ID since that's likely the intended. Cc: Eric W. Biederman Link: https://public-inbox.org/meta/87pniltscf.fsf@x220.int.ebiederm.org/ --- script/public-inbox-learn | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'script/public-inbox-learn') diff --git a/script/public-inbox-learn b/script/public-inbox-learn index 79f3ead5..3073294a 100644 --- a/script/public-inbox-learn +++ b/script/public-inbox-learn @@ -95,8 +95,9 @@ if ($train eq 'spam') { next if $seen{"$ibx"}++; remove_or_add($ibx, $train, $addr); } - my $ibx = PublicInbox::MDA->inbox_for_list_id($pi_config, $mime); - if ($ibx && !$seen{"$ibx"}) { + my $dests = PublicInbox::MDA->inboxes_for_list_id($pi_config, $mime); + for my $ibx (@$dests) { + next if !$seen{"$ibx"}++; remove_or_add($ibx, $train, $ibx->{-primary_address}); } } -- cgit v1.2.3-24-ge0c7