[Spambayes] Outlook plugin errors with Exchange

Mark Hammond mhammond@skippinet.com.au
Sat Nov 2 00:42:38 2002


> I'd like to report some problems I'm having with the Outlook plugin. I
> hope this is the right place.

Me too <wink>.  I think it will be until we annoy everyone else
sufficiently!

> - spambayes CVS (currrent)

I'm sure it was at the time <wink>

> 1) It looks like the plugin is having problems hooking the folder events
> for the exchange message store. When I use the 'Filter Rules' dialog to
> select my exchange inbox, I get the following exception in PythonWin:

Hmmm.  This is a little strange.  I would not be surprised to find Outlook
can't hook Exchange folder events, but this is failing before that - it is
failing just getting a regular Outlook "MAPIFolder" object for that folder.

We may be able to get a little further offline.

> 2) okay, so I have events hooked on my hotmail and .pst stores. If I
> move an unread message into _either_ of these folders, I get the
> following exception:

This one is now fixed in CVS.

> 3) messages sent from one exchange account to another (ie, never going
> over SMTP) have no headers. This may be a problem since the parser can
> never infer the sender or any other metadata about the message. It might
> be useful to have a special tag that says that the message has no
> headers, since such email is very probably ham. Alternatively, some SMTP
> headers could be faked up from the various MAPI properties.

This is true, and known.  We could synthesize some headers in this case.
However, no one else involved on the project has this problem, so
contributions welcome.  You did read the "about" text, right? <wink>

> 4) for some reason, my outlook is prefixing the headers of SMTP mail
> with the string "Microsoft Mail Internet Headers Version 2.0\r\n", and

Probably because this mail is coming in via the exchange mail gateway,
rather than directly fetched by the Outlook client's internet mail
capabilities.

> This string is also shown in the 'options' dialog for the message (on
> both OutlookXP and Outlook2K) so I think it's something that exchange
> server adds to the message, ugh. Here's a patch that fixes this for me
> and at least allows me to train on a full set of messages:
>
> Index: email/Parser.py
> ===================================================================
> RCS file: /cvsroot/spambayes/spambayes/email/Parser.py,v
> retrieving revision 1.1.1.1
> diff -u -r1.1.1.1 Parser.py
> --- email/Parser.py	23 Sep 2002 13:18:55 -0000	1.1.1.1
> +++ email/Parser.py	1 Nov 2002 22:17:34 -0000
> @@ -101,6 +101,8 @@
>                  elif lineno == 1 and line.startswith('--'):
>                      # allow through duplicate boundary tags.
>                      continue
> +                elif lineno == 1 and line.startswith('Microsoft Mail
> Internet Headers Version '):
> +                    continue
>                  else:
>                      raise Errors.HeaderParseError(
>                          "Not a header, not a continuation:
> ``%s''"%line)

I wonder if there is another property on the message that holds the prefix?
I might send you some scripts to try <wink>

Mark.