Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Exchange
2000.active.directory
2000.admin
2000.announcements
2000.app.conversion
2000.applications
2000.clients
2000.clustering
2000.connectivity
2000.development
2000.documentation
2000.general
2000.information.store
2000.interop
2000.kms
2000.misc
2000.protocols
2000.realtime.collabo.
2000.setup
2000.transport
2000.win2000
admin
application.conversion
applications
clients
clustering
connectivity
design
development
misc
mobility
setup
tools
  
 
date: Tue, 11 Dec 2007 09:45:45 +0100,    group: microsoft.public.exchange.development        back       


Exchange 2007 SP1 SDK   
Hi all,

I installed a few days ago Exchange 2007 SP1 SDK on 64-bit machine with 
64-bit Exchange 2007 installed. I wanted to learn how transport agents for 
Exchange 2007 work. So I built, installed and started an SDK sample named 
"BodyConversion". However, it does not work properly in my environment. Is 
is supposed to add a disclaimers to messages received by Exchange via SMTP 
protocol, it hooks to the OnEndOfData event. In my case, it removes the 
entire content of the message body instead adding a disclaimer! I tried with 
plain text and HTML messages - I always encounter the same problem. I know 
that the agent is running, because I can debug it and when I uninstall it, I 
can receive and send emails properly.

Is there anyone who could successfully run this sample or maybe someone who 
encountered the same problem?

Best regards,
Michal [Outlook MVP]
date: Tue, 11 Dec 2007 09:45:45 +0100   author:   Michal

Re: Exchange 2007 SP1 SDK   
Looks like a bad sample I get the same result I tracked it down to them not 
Flushing the stream which means the changes don't get committed so for each 
section which deals with the different bodytype you need to add some code in 
so the stream is flushed eg for the plain text section something like this 
seems to fix the problem

try
                {
                    // the easiest way to do the conversion in one step is 
using the Convert
                    // method. It takes care for creating appropriate 
converter stream
                    // and copying from one stream to another.
                    textToTextConversion.Convert(originalBodyContent, 
newBodyContent);
                    newBodyContent.Flush();
                    newBodyContent.Close();
                }


Cheers
Glen


"Michal"  wrote in message 
news:eaK9fI9OIHA.4136@TK2MSFTNGP03.phx.gbl...
> Hi all,
>
> I installed a few days ago Exchange 2007 SP1 SDK on 64-bit machine with 
> 64-bit Exchange 2007 installed. I wanted to learn how transport agents for 
> Exchange 2007 work. So I built, installed and started an SDK sample named 
> "BodyConversion". However, it does not work properly in my environment. Is 
> is supposed to add a disclaimers to messages received by Exchange via SMTP 
> protocol, it hooks to the OnEndOfData event. In my case, it removes the 
> entire content of the message body instead adding a disclaimer! I tried 
> with plain text and HTML messages - I always encounter the same problem. I 
> know that the agent is running, because I can debug it and when I 
> uninstall it, I can receive and send emails properly.
>
> Is there anyone who could successfully run this sample or maybe someone 
> who encountered the same problem?
>
> Best regards,
> Michal [Outlook MVP]
>
date: Wed, 12 Dec 2007 10:41:15 +1100   author:   Glen Scales [MVP]

Re: Exchange 2007 SP1 SDK   
"Glen Scales [MVP]" wrote:
> Looks like a bad sample I get the same result I tracked it down to them 
> not Flushing the stream which means the changes don't get committed so for 
> each section which deals with the different bodytype you need to add some 
> code in so the stream is flushed eg for the plain text section something 
> like this seems to fix the problem
>
[...]

Thanks a lot Glen! Now it works as supposed.

-- Michal
date: Wed, 12 Dec 2007 09:31:32 +0100   author:   Michal

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us