($spamonly): New global.
(MAIN): Call filter_mail only if not $spamonly.
=head1 SYNOPSIS
-B<minc> [-B<dhn>]
+B<minc> [-B<dhns>]
=head1 DESCRIPTION
Dry run; do not actually incorporate the mail, but log and report to
stdout/stderr as normal.
+=item B<-s>
+
+Process SPAM only, then exit, leaving all non-spam messages in the
+maildir.
+
=back
=cut
my $dumpfilters = 0;
my $run = 1;
+my $spamonly = 0;
+
our $opt_d;
our $opt_h;
our $opt_n;
-if (!getopts('dhn')) {
+our $opt_s; # ;; # stupid cperl-mode
+
+if (!getopts('dhns')) {
exit(&EX_USAGE);
}
+
if ($opt_d) {
$dumpfilters = 1;
} elsif ($opt_h) {
$run = 0;
}
+if ($opt_s) { # ))){ # stupid cperl-mode
+ $spamonly = 1;
+}
+
=head1 ENVIRONMENT
=over 4
}
@msglist = kill_spam(glob("$MAILDIR/new/*"));
- filter_mail(@msglist);
+
+ if (not $spamonly) {
+ filter_mail(@msglist);
+ }
}
__END__