[Spambayes] Outlook addin crash

Paul Moore lists@morpheus.demon.co.uk
Fri Nov 22 21:19:07 2002


"Moore, Paul" <Paul.Moore@atosorigin.com> writes:

> From: Moore, Paul 
>> Just got the following in the Outlook addin. No idea what caused it,
>> but the "Exception in thread xxxx" messages are probably the relevant
>> bits (I spent a while trying to get the "Filter Now" button to work
>> before I thought of starting traceutil).
>
> Got it, by a bit of binary search my new messages...
>
> I had an appointment confirmation in my inbox, which was causing the addin
> to crash. I'd suggest that anything other than a mail item be ignored
> when filtering.

Hmm, the fix isn't obvious. In manager.py, BayesManager.score() is
where it goes wrong - msg.GetEmailPackageObject() fails.

I suspect that the correct solution is to default the score to 0 (ham)
for non-mail objects (on the basis that spammers don't send
appointments...). However, we're too late at this point - the place
where we're interacting with the MAPI object is in msgstore.py,
_GetMessageText. We could check PR_MESSAGE_CLASS there for IPM.Note,
but what do we do with non-notes?

The best I can think of is to define an exception class,
NonMessageException, and raise it in _GetMessageText. We can then
catch it in score() and handle it appropriately there. But I'm not
100% convinced that this isn't an abuse of exceptions...

But I can't think of a better answer short of a fairly major
restructuring.

Paul.
-- 
This signature intentionally left blank



More information about the Spambayes mailing list