($spamonly): New global.
(MAIN): Call filter_mail only if not $spamonly.
Dry run; do not actually incorporate the mail, but log and report to
stdout/stderr as normal.
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;
=back
=cut
my $dumpfilters = 0;
my $run = 1;
our $opt_d;
our $opt_h;
our $opt_n;
our $opt_d;
our $opt_h;
our $opt_n;
+our $opt_s; # ;; # stupid cperl-mode
+
+if (!getopts('dhns')) {
if ($opt_d) {
$dumpfilters = 1;
} elsif ($opt_h) {
if ($opt_d) {
$dumpfilters = 1;
} elsif ($opt_h) {
+if ($opt_s) { # ))){ # stupid cperl-mode
+ $spamonly = 1;
+}
+
=head1 ENVIRONMENT
=over 4
=head1 ENVIRONMENT
=over 4
}
@msglist = kill_spam(glob("$MAILDIR/new/*"));
}
@msglist = kill_spam(glob("$MAILDIR/new/*"));
+
+ if (not $spamonly) {
+ filter_mail(@msglist);
+ }