[Spambayes] [Outlook addin] Filtering unread messages on startup

Moore, Paul Paul.Moore@atosorigin.com
Thu Nov 14 15:51:49 2002


Here's a first cut at filtering any new unread messages when Outlook
starts up (important for Exchange or IMAP users). It works, at least
for my limited testing, but there are a couple of points I think
need looking at. So far, I've tested it manually - the crunch comes
tomorrow morning, when I'll have received my overnight dose of spam
:-)

First, the msg.unread property doesn't seem to be set right - the
diagnostic output shows my code having filtered all of my inbox, not
just the unread messages. This, if true, is obviously a bug. (On the
other hand, it may be a bug in my code - I don't understand that stuff
too well...) I can't see a simple way of checking this.

Maybe I should only filter unread, unscored messages - the attached
code doesn't do this, as I would have to wait for new mail to arrive
if I were skipping scored messages. I'll add that once the basic thing
is working.

Second, an efficiency point - I'm going through the whole inbox via
GetMessageGenerator(). In my case, my inbox has 365 messages, with
only 4 unread. I was going to use the MAPI Find/FindNext methods,
but the msgstore code doesn't expose them. Would it be worth having
a method for just scanning unread messages (it could be used in the
filter dialog, too)?

Anyway, any comments would be appreciated.
Paul.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: addin.patch
Type: application/octet-stream
Size: 1832 bytes
Desc: addin.patch
Url : http://mail.python.org/pipermail/spambayes/attachments/20021114/f19b3b41/addin.exe


More information about the Spambayes mailing list