From: epg <> Date: Sun, 25 Aug 2002 18:41:32 +0000 (+0000) Subject: New -s option, for processing spam only. X-Git-Url: https://diplodocus.org/git/minc/commitdiff_plain/fcf031685ba99d8ed7352821617b6dcc92ce41da New -s option, for processing spam only. ($spamonly): New global. (MAIN): Call filter_mail only if not $spamonly. --- diff --git a/minc b/minc index 3cbd090..20a88f4 100755 --- a/minc +++ b/minc @@ -8,7 +8,7 @@ B - Incorporate mail from a maildir into mh folders. =head1 SYNOPSIS -B [-B] +B [-B] =head1 DESCRIPTION @@ -65,18 +65,28 @@ Show help. 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) { @@ -86,6 +96,10 @@ if ($opt_d) { $run = 0; } +if ($opt_s) { # ))){ # stupid cperl-mode + $spamonly = 1; +} + =head1 ENVIRONMENT =over 4 @@ -448,7 +462,10 @@ MAIN: { } @msglist = kill_spam(glob("$MAILDIR/new/*")); - filter_mail(@msglist); + + if (not $spamonly) { + filter_mail(@msglist); + } } __END__