[spambayes-dev] saving attachments

Ryan Malayter rmalayter at bai.org
Mon Mar 8 18:43:19 EST 2004

[Tim Peters]
>Right on both counts.  We could do a better job of trying to 
>*synthesize* MIME structure in the Outlook addin, but it's 
>painful and nobody yet has bothered. 

This doesn't seem like it would be that hard, I will take a look at the
relevant portions of the code. I've done some work with CDO and
attachments for other projects, so I know a bit about how Outlook
handles them. 

>Note that Outlook itself synthesizes MIME structure again if, e.g., 
>you forward a message with attachments (MIME is the > only standard 
>way to ship that to another machine, so Outlook is forced to play 
>along then;

Perhaps we could use that process as a bootstrap of some sort? Forward
the message to some strange internet recipient to get the MIME-formatted
message from outlook? Probably not, though, since it still hides this
from the plug-in object model, right?

>the underlying problem here is that Outlook's message store 
>was designed before there were common standards for dealing 
>with modern email, and so it's an endlessly nasty battle at 
>the Outlook API level).

Exchange Server 2000 and newer store all RFC-formatted messages (i.e.
inbound mail from internet sources) in an unaltered form in the "stream
store" rather than in the main Exchange database. You can actually
access these raw RFC-formatted messages on the Exchange server side
through the Exchange file system driver or CDO-Exchange.

Also, I know that Outlook 2003 has enhancements with regards to
message-format standards compliance as well, and Exchange 2003 will not
convert messages from the standard RFC format if you read them with
Exchange 2003. (All Outlook clients earlier than 2003 request all
messages in the old MAPI format from the server, regardless of the
originating format. Exchange 2000/2003 convert messages from RFC format
on the fly when talking with older Outlook clients.)

So perhaps this problem will solve itself in future Outlook versions?
Should we just wait for Microsoft to do the work for us? Or maybe there
is new stuff in the Outlook 2003 API to address this? From looking at
the "What's New in Outlook 2003" articles on MSDN, it doesn't appear so,
but I'm no expert in this area.

I also found this MAPI-to-RFC822 conversion utility, which appears to be
at least somewhat open source, and may prove a useful guide for
reassembling Outlook messages from outlook into RFC format for


More information about the spambayes-dev mailing list