I am trying to get Exchange 2010 to change the MessageClass (PR_MESSAGE_CLASS) of an incoming message to that of my custom form (IPM.Note.MyCustom) when the incoming message has a certain header set. (X-MyCustomHeader: Yes
)
I have seen some information about setting another MIME header (Content-Class:
) that Exchange will use to set the MessageClass, but it doesn't seem to work for me. (I've seen examples that use Content-Class: MyCustom
and Content-Class: urn:content-class:custom.MyCustom
)
I've even looked into writing a transport agent with C#, and I did find a MapiMessageClass
property on the EmailMessage
class, but it's read-only. I also looked at added a MAPI property in a TNEF section, but the Exchange API does not offer a way to create a TNEF section if one does not already exist. (And most mail from the Internet doesn't.)
There's got to be a way to do this. What am I missing?