sub _remove_spam {
my ($self, $path) = @_;
- $path =~ /:2,[A-R]*S[T-Z]*\z/i or return;
+ # path must be marked as (S)een
+ $path =~ /:2,[A-R]*S[T-Za-z]*\z/ or return;
my $mime = _path_to_mime($path) or return;
_force_mid($mime);
$self->{config}->each_inbox(sub {
$im->remove($scrubbed);
}
};
- warn "error removing spam at $path from $ibx->{name}\n" if $@;
+ if ($@) {
+ warn "error removing spam at: ", $path,
+ " from ", $ibx->{name}, ': ', $@, "\n";
+ }
})
}
my ($inbox) = @_;
my $f = $inbox->{filter};
if ($f && $f =~ /::/) {
- my @args;
+ my @args = (-inbox => $inbox);
# basic line splitting, only
# Perhaps we can have proper quote splitting one day...
($f, @args) = split(/\s+/, $f) if $f =~ /\s+/;