[PATCH] missing directory info [was: bogofilter headache # 0.16.4]

David Relson relson at osagesoftware.com
Wed Feb 25 05:49:55 CET 2004


On Tue, 24 Feb 2004 22:38:35 -0500 (EST)
Mail lists wrote:

> I wrote:
> 
> > But if /usr/local/bin/bogo-doit reads
> > 
> >   !#/bin/sh
> > 
> >   bogofilter -p -e -u -l -O /tmp/looka
> > 
> > the bad bogofilter dumps core
> > 
> 
> That's because this year's bogofilter seems to require the form
> 
>     bogofilter -p -e -u -l -O /tmp/looka -d
>     PATH_TO_.BOGOFILTER_DIRECTORY
> 
> Fixed!

Bogofilter needs to know where the wordlist is located.  Itr checks the
command line, the config file (/etc/bogofilter.cf or ~/.bogofilter.cf),
and environment variables (BOGOFILTER_DIR and HOME) for the directory
name.  If none of those are set, it can't operate.  My guess is that
neither HOME nor BOGOFILTER_DIR is set and you're not using a config
file.

The patch below will complain and exit, rather than dumping core.  Let
me know if it's helpful.

David

--- wordlists.c.~1.45	2004-01-01 08:34:50.000000000 -0500
+++ wordlists.c	2004-02-24 23:45:46.000000000 -0500
@@ -73,6 +73,11 @@
     wordlist_t *list;
     int retry;
 
+    if (word_lists == NULL) {
+	fprintf(stderr, "Can't find wordlist.db; no directory specified.\n");
+	exit(EX_ERROR);
+    }
+
     do {
 	retry = 0;
 	for (list = word_lists; list != NULL; list = list->next) {




More information about the Bogofilter mailing list