From 7f8e60a7eeaa083d16284e89dd4023a0f51e0ad9 Mon Sep 17 00:00:00 2001 From: "Bradley M. Kuhn" Date: Sun, 21 Nov 2010 09:18:04 -0500 Subject: [PATCH] Fixed Confidence comparison and added actual unlink. --- remove-spam-high-confidence-maildir.plx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/remove-spam-high-confidence-maildir.plx b/remove-spam-high-confidence-maildir.plx index fa58d0c..159b4fc 100644 --- a/remove-spam-high-confidence-maildir.plx +++ b/remove-spam-high-confidence-maildir.plx @@ -65,16 +65,18 @@ MAIL: foreach my $dir (@msgDirs) { } $total++; - if ($dspamVal{Confidence} >= $DSPAM_PROB_MIN and - $dspamVal{Probability} >= $DSPAM_CONF_MIN) { + if ($dspamVal{Confidence} >= $DSPAM_CONF_MIN and + $dspamVal{Probability} >= $DSPAM_PROB_MIN) { $countDeleted++; + warn "unable to unlink $dir/$file : $!" + unless unlink("$dir/$file") == 1; } close MAIL_MESSAGE; } close MAILDIR; } -print "$countDeleted of $total would be deleted\n"; +print "$countDeleted of $total were deleted\n"; ############################################################################### #