- # We do not touch GIT_COMMITTER_* env here so we can track
- # who trained the message.
- # We will not touch GIT_AUTHOR_* when learning spam messages, either
- if ($train eq "spam") {
- # This needs to be idempotent, as my inotify trainer
- # may train for each cross-posted message, and this
- # script already learns for every list in
- # ~/.public-inbox/config
- if (!run(["ssoma-rm", $git_dir], \$in, \$out, \$err)) {
- if ($err !~ /^git cat-file .+ failed: 32768$/) {
- $err = 1;
- }
+ # get all recipients
+ my %dests; # address => <PublicInbox::Inbox|0(false)>
+ for ($mime->header('Cc'), $mime->header('To')) {
+ foreach my $addr (PublicInbox::Address::emails($_)) {
+ $addr = lc($addr);
+ $dests{$addr} //= $pi_config->lookup($addr) // 0;