Removed useless outer loop; Corrected close()'s; Fixed Emacs compile

command
This commit is contained in:
Bradley M. Kuhn 2010-11-20 17:20:38 -05:00
parent 6fbe116841
commit 509be144a2

View file

@ -32,8 +32,8 @@ my($MAILDIR_FOLDER, $DSPAM_PROB_MIN, $DSPAM_CONF_MIN) = @ARGV;
my($total, $countDeleted) = (0, 0); my($total, $countDeleted) = (0, 0);
foreach my $folder (@dupFolders) { my @msgDirs = ("$MAILDIR_FOLDER/cur", "$MAILDIR_FOLDER/new");
my @msgDirs = ("$folder/cur", "$folder/new");
foreach my $dir (@msgDirs) { foreach my $dir (@msgDirs) {
die "$MAILDIR_FOLDER must not be a maildir folder (or is unreadable by you), since $dir isn't a readable directory: $!" die "$MAILDIR_FOLDER must not be a maildir folder (or is unreadable by you), since $dir isn't a readable directory: $!"
unless (-d $dir); unless (-d $dir);
@ -63,14 +63,12 @@ foreach my $folder (@dupFolders) {
next; next;
} }
} }
$total++; $total++;
if ($dspamVal{Confidence} >= $DSPAM_PROB_MIN and if ($dspamVal{Confidence} >= $DSPAM_PROB_MIN and
$dspamVal{Probability} >= $DSPAM_CONF_MIN) { $dspamVal{Probability} >= $DSPAM_CONF_MIN) {
$countDeleted++; $countDeleted++;
} }
}
close MAIL_MESSAGE; close MAIL_MESSAGE;
} }
close MAILDIR; close MAILDIR;
@ -81,5 +79,5 @@ print "$countDeleted of $total would be deleted\n";
############################################################################### ###############################################################################
# #
# Local variables: # Local variables:
# compile-command: "perl -c remove-dup-mails-from-maildir.plx" # compile-command: "perl -c remove-spam-high-confidence-maildir.plx"
# End: # End: