Ignore lists [was: Keeping the cruft out ...]

Matthias Andree matthias.andree at gmx.de
Fri Mar 5 01:48:12 CET 2004


On Fri, 05 Mar 2004, Pavel Kankovsky wrote:

> On Thu, 4 Mar 2004, David Relson wrote:
> 
> > It _could_ be done that way, but it seems messy.  The old code required
> > the existance of an ignore.db file (that could be built from a simple
> > text file using bogoutil).  An alternate approach would be to simply
> > read the simple text file.
> 
> You'd still have to do two lookups: one in the list of ignored tokens (or
> perhaps in some in-memory structure built from the text file), the other
> in the main db. It depends on the expected size of the list. If it is
> supposed to be really tiny (say < 1 page) then the extra overhead needed
> to read a file and build a hash table (?) would be negligible.

Indeed. The list of ignored _headers_ could be even shorter if this was
desired.

> > Having "ignored" tokens in the regular database calls for adding an
> > "ignore" flag or using an unlikely value (such as 0xFFFFFFFF).  I expect
> > special checks would quickly spread throughout bogofilter, which would
> > be bad.
> 
> I think it might be possible to hide the implementation details in the
> datastore layer (maybe in the datastore "middleware", e.g. datastore.c).
> But I am aware you know the innards of Bogofilter better than I. :)

It would be doable, but I, too, are no particular friend of using magic
values for special purposes, i. e. overloading tokens or token values or
something. This will still add special casing all over the code which is
not exactly making the code more maintainable.

-- 
Matthias Andree

Encrypt your mail: my GnuPG key ID is 0x052E7D95




More information about the Bogofilter mailing list