mbox v maildir problems.

David Relson relson at osagesoftware.com
Sat Sep 13 14:04:53 CEST 2003


On 13 Sep 2003 20:56:43 +1000
michael at optusnet.com.au wrote:

...[snip]...

> /* global reader initialization, exported */
> void bogoreader_init(int _argc, char **_argv)
> {
>     mailstore_first = mail_first = true;
>     reader_more = reader__next_mail;
>     fini = dummy_fini;
>     if (run_type & (REG_SPAM|REG_GOOD|UNREG_SPAM|UNREG_GOOD))
>         mbox_mode = true;
> [...]
> 
> which forces mbox mode on while training! argh!!! :)
> 
> This is trivial fix. Those last two lines just shouldn't
> be there. The problem is that this will change the behaviour
> of bogofilter for people that are currently not passing '-M'
> to bogofilter.
> 
> A half-way house would be to move those two lines innto
> the B_NORMAL case of the switch following. (So we only
> turn on mbox_mode when we're not doing bulk mode).
> 
> All options are horrible. :)
> 
> Comments?
> 
> Michael.

Hi Michael,

Good analysis!  Also, thank you for suggesting a solution.  The check
and setting of mbox=true may well be kludgy.  As you point out, it's
purpose is to preserve bogofilter's historic behavior when registering
messages.  Tying those two lines to B_NORMAL seems like the right way to
go.  If someone wants combine bulk mode with mboxes, '-M' can be
combined with '-B'/'-b'.

I've moved the run_type test to B_NORMAL and run "make check" and all is
fine.  I also ran the test below with two small mboxes to check that
'-M' interacts with '-B' as desired.  The basic behavior seems proper
and the message counts are find.  However the token counts don't match. 
I'll have to investigate to see what's happening.

David

*** test results ***

[relson at osage src]$ rm -f wordlist.db ; for f in g?.mbx ; do bogofilter
-n -d . -I $f -v ; done
# 439 words, 2 messages
# 893 words, 3 messages

[relson at osage src]$ rm -f wordlist.db;  bogofilter -n -v -d . -B g?.mbx
# 1265 words, 2 messages

[relson at osage src]$ rm -f wordlist.db ; bogofilter -n -v -d . -B -M
g?.mbx
# 1176 words, 5 messages




More information about the Bogofilter mailing list