bogofilter on opensolaris with sqlite

David Relson relson at osagesoftware.com
Sun Jan 24 06:03:46 CET 2010


timejumper:

Indeed function compute_robinson_x in file src/robx.c has a divide by
zero problem (for a new ham-free wordlist such as yours).  The fix is
below and has been committed to subversion.

Thanks for reporting the problem.

Regards,

David

Index: src/robx.c
=================================================================== 
--- src/robx.c	(revision 6867) 
+++ src/robx.c	(working copy)
@@ -83,8 +83,8 @@
 
     dsh = wordlist->dsh;
 
-    rh.spam_cnt = wordlist->msgcount[IX_SPAM];
-    rh.good_cnt = wordlist->msgcount[IX_GOOD];
+    rh.spam_cnt = max(wordlist->msgcount[IX_SPAM],1);
+    rh.good_cnt = max(wordlist->msgcount[IX_GOOD],1);
     rh.scalefactor = (double)rh.spam_cnt/(double)rh.good_cnt;
 
     rh.dsh = dsh;



More information about the Bogofilter mailing list