]> diplodocus.org Git - minc/commitdiff
New -s option, for processing spam only.
authorepg <>
Sun, 25 Aug 2002 18:41:32 +0000 (18:41 +0000)
committerepg <>
Sun, 25 Aug 2002 18:41:32 +0000 (18:41 +0000)
($spamonly): New global.

(MAIN): Call filter_mail only if not $spamonly.

minc

diff --git a/minc b/minc
index 3cbd090..20a88f4 100755 (executable)
--- a/minc
+++ b/minc
@@ -8,7 +8,7 @@ B<minc> - Incorporate mail from a maildir into mh folders.
 
 =head1 SYNOPSIS
 
-B<minc> [-B<dhn>]
+B<minc> [-B<dhns>]
 
 =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__