From: epg <> Date: Sun, 1 Sep 2002 06:03:25 +0000 (+0000) Subject: Add new -f option, for only running filters. X-Git-Url: https://diplodocus.org/git/minc/commitdiff_plain/5e0e58e5ae11f3c971600f67b7deef704ec5c375?hp=6f957f340e30cf3c502783735619ed05e3a0d147 Add new -f option, for only running filters. --- diff --git a/minc b/minc index a572cfe..fb89834 100755 --- a/minc +++ b/minc @@ -46,6 +46,10 @@ use POSIX qw(strftime WEXITSTATUS WIFEXITED); Dump (using Data::Dumper) the FILTERS hash and exit. This is useful for testing the syntax of .mincfilter. +=item B<-f> + +Filter only, then exit. This is useful after running B. + =item B<-h> Show help. @@ -65,10 +69,12 @@ maildir. =cut my $dumpfilters = 0; +my $filteronly = 0; my $run = 1; my $spamonly = 0; our $opt_d; +our $opt_f; our $opt_h; our $opt_n; our $opt_s; # ;; # stupid cperl-mode @@ -86,7 +92,9 @@ if ($opt_d) { $run = 0; } -if ($opt_s) { # ))){ # stupid cperl-mode +if ($opt_f) { + $filteronly = 1; +} elsif ($opt_s) { # ))){ # stupid cperl-mode $spamonly = 1; } @@ -583,7 +591,11 @@ MAIN: { exit(&EX_OK); } - @msglist = kill_spam(getfiles("$MAILDIR/new")); + @msglist = getfiles("$MAILDIR/new"); + + if (not $filteronly) { + @msglist = kill_spam(@msglist); + } if (not $spamonly) { filter_mail(@msglist);