[spambayes-dev] Code locations in Spambayes Outlook plugin
Tim Peters
tim.one at comcast.net
Fri Nov 14 01:14:57 EST 2003
[TP Diffenbach]
> I'd like to extend the Spambayes Outlook plugin a bit.
>
> In the Spambayes Outlook Plugin, in which module are the header lines
> (Outlook lingo: CdoPR_TRANSPORT_MESSAGE_HEADERS) extracted?
The plugin doesn't use the CDO API -- it's too problematic across Outlook
variations (e.g., it appears it's not even available in most IMO
configurations, unless the user manually installs CDO from their Office CD).
It uses low-level MAPI instead. Search the source for the MAPI
PR_TRANSPORT_MESSAGE_HEADERS_A property and you'll soon find it. Be warned
that raw MAPI can be extremely painful to work with (although it's a hell of
a lot easier to work with from Python than from C!); OTOH, it's much faster
than CDO too, and that's important to the plugin for high-volume users.
> In which module is the spam percentage score added to the Outlook
> mail item?
The same module you'll find above, in the SetField method of class
MAPIMsgStoreMsg (I'm resisting becoming a remote search button in your text
editor <wink>).
> (Why I'm doing this: the headers aren't accessible in Outlook except
> via View|Options, or programmatically. I want an Outlook form that
> automatically displays the headers, but doing it in Visual Basic
> Script is problematic because of Outlook's security policies.
Using MAPI directly appears to sidestep most Outlook whining. At least so
far.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 1040 bytes
Desc: not available
Url : http://mail.python.org/pipermail/spambayes-dev/attachments/20031114/3e30d968/winmail.bin
More information about the spambayes-dev
mailing list