- foreach my $inbox (values %{$self->{mdmap}}) {
- next unless ref $inbox;
- my $im = _importer_for($self, $inbox);
- $im->remove($mime);
- if (my $scrub = _scrubber_for($inbox)) {
- my $scrubbed = $scrub->scrub($mime) or next;
- $im->remove($scrubbed);
+ $self->{config}->each_inbox(sub {
+ my ($ibx) = @_;
+ eval {
+ my $im = _importer_for($self, $ibx);
+ $im->remove($mime);
+ if (my $scrub = _scrubber_for($ibx)) {
+ my $scrubbed = $scrub->scrub($mime) or return;
+ $scrubbed == 100 and return;
+ $im->remove($scrubbed);
+ }
+ };
+ if ($@) {
+ warn "error removing spam at: ", $path,
+ " from ", $ibx->{name}, ': ', $@, "\n";