[Spambayes] Re: imapfilter mangling headers!

David Abrahams dave at boost-consulting.com
Mon Apr 21 09:31:36 EDT 2003

"Meyer, Tony" <T.A.Meyer at massey.ac.nz> writes:

>> >> Indeed.  The UI script even has a syntax error (missing a
>> >> colon).
>> > Well, there aren't any scripts that use the UI module, so 
>> > that really shouldn't matter.
>> ?!? You can't even invoke the script unless it can be compiled!
> That's my point; let me spell it out more: at that stage the ImapUI.py
> module (which had the error) was not imported by *any* spambayes module.
> Since nothing used it, nothing invoked it, and nothing tried to compile
> it.  (Things have changed since, and it does compile, and work, and get
> imported by imapfilter.py).
>> > And even the trial ones that I haven't checked in
>> > don't use that function...
>> How did you manage to test them?
> I did the testing before the function was added (and I tested that
> function without the line that had the syntax error, which, ironically,
> was only a test that the previous line worked).  Since the function
> wasn't used, I didn't test afterwards since none of the code that was
> used had changed.  If the module was used by anything else I would have
> done a cursory check that would have picked up the syntax error, but it
> really wasn't necessary.

Just to be clear, I wouldn't have even mentioned it if you'd just said
"that's prerelease code" or if Tim hadn't mentioned that it was there.
However, you indicated that you had used test scripts with it, which
crossed a few wires in my logic circuits.

>> I wrote a bayescustomize.ini, but the entries seemed to be ignored.
> Spambayes might not have been finding it.  It should be found if it is
> in the current working directory (although I've found this a little
> unreliable sometimes), but it will definitely be found if the path is in
> the envar BAYESCUSTOMIZE.  (I'll add this to the docs, too).  

I got it found eventually.  I think I thought at one point that it
could live in my home directory... I guess not.

> It's easy to test if it's reading it - add some entry that doesn't
> exist in spambayes (like "option_does_not_exist: True") and try to
> run pop3proxy or imapfilter.  You'll get an error message about an
> invalid option if it is finding it.  If it does find it and ignore
> entries made, then this is definitely a bug and should be reported
> (with details about which entries are being ignored).
>> I have serious doubts that I'll be able to run a browser on 
>> the machine where I want to do this, so I don't think the web 
>> ui will be an option.
> Well, I guess then I'll add some documentation (maybe a FAQ) for people
> in this situation.  The reason there isn't any yet is that no-one has
> said that they can't run a browser but want to use pop3proxy or
> imapfilter.  It's probably also been taken for granted that people using
> spambayes without the web ui know what a config file looks like, given
> that they're using software that hasn't even made it to beta yet.
>> > bayescustomize.ini uses the standard configuration format.
>> ...which is documented where?
> <http://www.python.org/doc/current/lib/module-ConfigParser.html>

I eventually found that by crawling through the spambayes code.

> Or just google for ini file format.  

Now, you see, I don't know that "standard configuration format" means
the same as .ini file format.

> Or search for a file suffixed with .ini or .rc.  Or look at the
> default_bayes_customize.ini in the Outlook2000 folder.  

I'da had to find those, wouldn't I?

> Or look in the cvs history of Options.py at the one that used to be
> built in there.  (Given that this was the case until a couple of
> days ago, it's hardly surprising that newer documentation hasn't
> made it yet.

I'm not surprised; I'm just asking because I need to know.  Even if I
know about .ini file format (which, aside from forgetting whether it's
"name: value" or "name = value", I do), I still need to know what the
magic names to use are, and what their permissible values are.  I note
that when Options.py changed, many of the options lost their prefixes
(imap_whatever became just whatever), so my old patches to Options.py
couldn't just be transplanted into my .ini file.

> Remember that this is a collaborative, open-source,
> voluntary project...things take time...).

Of course I understand that, as I work primarily on that kind of

Thanks for the explanation,

Dave Abrahams
Boost Consulting

More information about the Spambayes mailing list