$im->remove($mime);
if (my $scrub = _scrubber_for($ibx)) {
my $scrubbed = $scrub->scrub($mime) or return;
+ $scrubbed == 100 and return;
$im->remove($scrubbed);
}
};
return unless ($v && $v =~ $wm->[1]);
}
if (my $scrub = _scrubber_for($inbox)) {
- $mime = $scrub->scrub($mime) or return;
+ my $ret = $scrub->scrub($mime) or return;
+ $ret == 100 and return;
+ $mime = $ret;
}
_force_mid($mime);
$im->add($mime, $self->{spamcheck});
}
+sub quit { $_[0]->{quit} = 1 }
+
sub watch {
my ($self) = @_;
my $cb = sub { _try_fsn_paths($self, \@_) };
# in the future...
require Filesys::Notify::Simple;
my $watcher = Filesys::Notify::Simple->new($mdir);
- $watcher->wait($cb) while (1);
+ $watcher->wait($cb) until ($self->{quit});
}
sub scan {
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+/;