[0.11.1] bogofilter -u doesn't update the database
David Relson
relson at osagesoftware.com
Wed Mar 5 21:29:44 CET 2003
At 03:08 PM 3/5/03, Alexander Wasmuth wrote:
>Hi again,
>
>I'm running bogofilter from procmail in passthrough/update-mode. I
>noticed that the database is not updated anymore. I've done a db-rebuild
>from scratch with 0.11.1.
... [snip] ...
>Is there anything I can do to help debug the problem?
Alexander,
Thank you for spotting and reporting this. It is indeed a problem and is
easily reproduced - hence easily corrected and patched.
Give the attached patch a try. It fixes the problem for me. For testing I
ran the following (simple) set of commands:
rm -f *.db
bogofilter -C -d . -s < msg.test
bogoutil -w . .MSG_COUNT
bogofilter -C -d . -u -v <msg.test
bogofilter -w . .MSG_COUNT
The two runs of bogoutil are to show how many messages are entered in each
wordlist.
The bogofilter flags are '-C' to skip reading config files, '-d .' to set
the BOGOFILTER_DIR, '-u' for update, and '-v' for verbose to tell me what's
happening.
Please let me know if the patch fixes bogofilter for you.
David
-------------- next part --------------
cvs diff main.c register.c
Index: main.c
===================================================================
RCS file: /cvsroot/bogofilter/bogofilter/src/main.c,v
retrieving revision 1.15
diff -u -r1.15 main.c
--- main.c 4 Mar 2003 21:21:41 -0000 1.15
+++ main.c 5 Mar 2003 20:21:14 -0000
@@ -71,7 +71,7 @@
init_charset_table(charset_default, true);
/* open all wordlists */
- open_wordlists((run_type & (RUN_NORMAL | RUN_UPDATE)) ? DB_READ : DB_WRITE);
+ open_wordlists((run_type == RUN_NORMAL) ? DB_READ : DB_WRITE);
if (*outfname && passthrough) {
if ((out = fopen(outfname,"wt"))==NULL)
Index: register.c
===================================================================
RCS file: /cvsroot/bogofilter/bogofilter/src/register.c,v
retrieving revision 1.4
diff -u -r1.4 register.c
--- register.c 1 Mar 2003 00:31:05 -0000 1.4
+++ register.c 5 Mar 2003 20:21:14 -0000
@@ -54,10 +54,10 @@
set_list_active_status(false);
- if (run_type & REG_GOOD) incr_list = good_list;
- if (run_type & REG_SPAM) incr_list = spam_list;
- if (run_type & UNREG_GOOD) decr_list = good_list;
- if (run_type & UNREG_SPAM) decr_list = spam_list;
+ if (_run_type & REG_GOOD) incr_list = good_list;
+ if (_run_type & REG_SPAM) incr_list = spam_list;
+ if (_run_type & UNREG_GOOD) decr_list = good_list;
+ if (_run_type & UNREG_SPAM) decr_list = spam_list;
if (DEBUG_REGISTER(2))
fprintf(dbgout, "%s%s -- incr: %08X, decr: %08X\n", r, u, (int)incr_list, (int)decr_list);
More information about the Bogofilter
mailing list