$data
});
-sub remove_or_add ($$$) {
- my ($ibx, $train, $addr) = @_;
+sub remove_or_add ($$$$) {
+ my ($ibx, $train, $mime, $addr) = @_;
# We do not touch GIT_COMMITTER_* env here so we can track
# who trained the message.
$im->done;
});
} else {
- require PublicInbox::MDA if $train eq "ham";
+ require PublicInbox::MDA;
# get all recipients
my %dests; # address => <PublicInbox::Inbox|0(false)>
}
# n.b. message may be cross-posted to multiple public-inboxes
+ my %seen;
while (my ($addr, $ibx) = each %dests) {
next unless ref($ibx); # $ibx may be 0
- remove_or_add($ibx, $train, $addr);
+ next if $seen{"$ibx"}++;
+ remove_or_add($ibx, $train, $mime, $addr);
+ }
+ my $dests = PublicInbox::MDA->inboxes_for_list_id($pi_config, $mime);
+ for my $ibx (@$dests) {
+ next if !$seen{"$ibx"}++;
+ remove_or_add($ibx, $train, $mime, $ibx->{-primary_address});
}
}