I ran into a divide-by-zero problem this morning when running
the amavisd log summary problem, with the attached patch fixes.
Bill
--
INTERNET: [EMAIL PROTECTED] Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way
FAX: (206) 232-9186 Mercer Island, WA 98040-0820; (206) 236-1676
``We shouldn't elect a President; we should elect a magician.''
Will Rogers
--- amavislogsumm-0.6 2005-08-17 08:14:33.000000000 -0700
+++ /tmp/amavislogsumm 2006-01-03 09:13:03.827429145 -0800
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/csrel22/bin/perl
#
# amavislogsumm - analyse amavisd-new logfiles. Read from STDIN
@@ -309,7 +309,7 @@
if ($spamCount > 0) {
printf "\tSPAM : %5.2f\n", ($spamHitSum / $spamCount);
}
- if (($timeLineCount - $spamCount) > 0) {
+ if (($timeLineCount - $spamCount - $unscoredMail) > 0) {
printf "\tHAM : %5.2f\n", ($noneSpamHitSum / ($timeLineCount -
$spamCount - $unscoredMail));
print "\n";
}