]> Sergey Matveev's repositories - public-inbox.git/blobdiff - script/public-inbox-learn
mda: support multiple List-ID matches
[public-inbox.git] / script / public-inbox-learn
index 79f3ead5c722cda3d17cea9f4fc8ea185fa39530..3073294a18bb526138d24e6898325157726c9586 100644 (file)
@@ -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});
        }
 }