[PATCH] bogotune [was: bogotune bugs?]

David Relson relson at osagesoftware.com
Sun Mar 20 16:47:58 CET 2005


On Sun, 20 Mar 2005 00:29:12 +0000 (UTC)
Jason Lunz wrote:

> does bogotune have known bugs? I'm using debian sarge, and I've tried
> both 0.94.0 and 0.94.1. No matter what I do, it says:
> 
> [mudd](0) % bogotune -n ham -s spam
> Calculating initial x value...
> Error: /home/lunz/.bogofilter/wordlist.db is not a directory.
> bogotune: cannot find bogofilter directory.
> You must specify a directory on the command line, in the config file,
> or by using the BOGOFILTER_DIR or HOME environment variables.
> Program aborting.
> Initial x value is 0.541073
> Too few high-scoring non-spams in this data set.
> [snip]
> 
> there's lots of other output, but i'm not inclined to trust it or try to
> figure out what it means if bogotune can't even seem to read the
> wordlist.
> 
> What are the error messages supposed to mean? Of course
> "/home/lunz/.bogofilter/wordlist.db is not a directory". It's not
> supposed to be.
> 
> I've tried different combinations of using BOGOFILTER_DIR, -d, giving
> the name of either wordlist.db itself or the directory it's in, and
> nothing works.
> 
> any ideas?
> 
> Jason

Hi Jason,

Digging into the bogotune code I found a directory/filename error which
the attached patch corrects.  Give it a try and let me know what happens.

David
-------------- next part --------------
--- bogotune.c.0941	2005-03-15 23:10:54.000000000 -0500
+++ bogotune.c	2005-03-20 10:35:44.000000000 -0500
@@ -1,4 +1,4 @@
-/* $Id: bogotune.c,v 1.204 2005/03/16 03:55:14 m-a Exp $ */
+/* $Id: bogotune.c,v 1.205 2005/03/20 15:35:44 relson Exp $ */
 
 /*****************************************************************************
 
@@ -1702,6 +1702,7 @@
 
     /* directories from command line and config file are already handled */
     if (ds_flag == DS_DSK) {
+	char *ds_file;
 
 	if (ds_path == NULL)
 	    ds_path = get_directory(PR_ENV_BOGO);
@@ -1712,8 +1713,9 @@
 	set_bogohome(ds_path);
 	env = ds_init(bogohome, WORDLIST);
 
-	ds_path = mxcat(ds_path, DIRSEP_S, WORDLIST, NULL);
-	init_wordlist("word", ds_path, 0, WL_REGULAR);
+	ds_file = mxcat(ds_path, DIRSEP_S, WORDLIST, NULL);
+	init_wordlist("word", ds_file, 0, WL_REGULAR);
+	xfree(ds_file);
     }
 
     bogotune();
-------------- next part --------------
_______________________________________________
Bogofilter mailing list
Bogofilter at bogofilter.org
http://www.bogofilter.org/mailman/listinfo/bogofilter


More information about the bogofilter mailing list