none
PidTagMessageEditorFormat better than Best Body Protocol spec? RRS feed

  • Question

  • Hello!

    I have some difficulties in detecting the correct body type for some mails using the "Best Body Protocol" specification...
    Some messages are probably a bit buggy, so using the spec i detect HTML, but RTF is correct. Some of these mails have the PidTagMessageEditorFormat set to RTF, so this could be a good choice, but how does this property correspond with the other message bodies?

    Regards

    Thorsten


    Best Regards/Viele Grüße Thorsten
    Wednesday, October 27, 2010 12:54 PM

Answers

  • Thorsten,
     
    If you follow the procedure outlined in Section 2.1 of [MS-OXBBODY] , you are able to determine the best format to use when parsing the message. This same process will also apply to .msg files as well. The steps involved will tell you to check the status of a rop or check a property. You must choose the latter and follow the same logic detailed in the specification.
     
    However, I must also inform you that if these files were generated by Outlook, the format is going to be RTF.
     
    I hope this helps.
     
    Dominic Salemno
    Escalation Engineer
    Open Specifications
     
    • Marked as answer by King Salemno Tuesday, November 16, 2010 8:36 PM
    Tuesday, November 16, 2010 8:36 PM

All replies

  • Hi Thorsten,

    Thanks for your question. One of our engineers will research your question and get in touch shortly.

    Regards,

    Edgar

    Wednesday, October 27, 2010 2:47 PM
    Moderator
  • Thorsten,

    Could you provide us with some wire captures so we can reproduce what you are seeing?

    Dominic Salemno
    Escalation Engineer
    Open Specifications

    Wednesday, October 27, 2010 6:34 PM
  • Thorsten,

    Send the wire captures to dochelp [at] microsoft.com

    Dominic Salemno
    Escalation Engineer
    Open Specifications

     

    Wednesday, October 27, 2010 6:40 PM
  • Hi Dominic,

    i'm not aware of "wire captures", but i sent an email with the following information:

    The challenge is to get the best formatted body out of a message. The message is a MSG file, I’m using MAPI to read the properties.

    I took exactly the Best Body Algorithm from [MS-OXBBODY] Best Body Retrieval Protocol Specification.

    Most messages give the correct body format, but I have some messages with problems.

     

    The properties I get from those messages are:

     

    PidTagNativeBody does not exist

    PlainStatus=NoError

    RtfStatus=NoError

    HtmlStatus=NoError

    RtfInSync=False

     

    The result of the algorithm is HTML, but HTML content is something like plain-text converted to HTML, so tables are missing and so on.

    When using the RTF Body all formats are ok, so it seems that the result of the algorithm is wrong.

    If I open the message with Outlook 2007, Outlooks opens the RTF editor, this is probably the result of the PidTagMessageEditorFormat property which is set to RTF.

    So does the PidTagMessageEditorFormat overrule the algorithm in Outlook? What is the right way?

    If you provide me with the information what "wire captures" are, i'll send them.

    Best Regards

    Thorsten


    Best Regards/Viele Grüße Thorsten
    Thursday, October 28, 2010 7:11 AM
  • G'day Thorsten,

    I think you are unlikely to have good results with using the Best Body algorithm on a .msg file. The algorithm is designed to work between a server (e.g. Exchange) and a client (e.g. Outlook) over an RPC connection (usually TCP/IP). That is the context in which a "wire capture" is meant - capturing packets as they travel over the network using a tool like Wireshark or Netmon. The server can convert between formats (e.g the client can upload HTML and download the same message in RTF format), so in this case, there is a meaning to the conversion.

    With the .msg format (which is documented in http://msdn.microsoft.com/en-us/library/cc463912%28EXCHG.80%29.aspx), you should inspect your file, determine which format is available, and then pick whichever one is the best for your situation.

    Discussion of what MAPI libraries can do on a particular platform is a bit out-of-scope for this forum. Perhaps you can find people with more knowledge on MAPI / Outlook programming  on another forum (perhaps http://social.msdn.microsoft.com/Forums/en-US/outlookdev/threads)?

    Good luck with this.

    Brad

    Thursday, October 28, 2010 9:29 AM
  • Thorsten,

     

    This algorithm is indeed performed via the wire as Brad has stated.

    How are you parsing the .msg file in question?

     

    Dominic Salemno
    Escalation Engineer

    Open Specifications

     

    Friday, November 5, 2010 5:15 PM
  • Thorsten,

    I am just confirming that I have received the information regarding your msg file analysis approach. I am continuing to research this scenario to determine the best course of action for you.

    Dominic Salemno

    Escalation Engineer

    Open Specifications

     

    Friday, November 5, 2010 5:16 PM
  • Thorsten,

    I shall have an answer for you shortly.

    Dominic Salemno
    Escalation Engineer
    Open Specifications

    Tuesday, November 16, 2010 6:52 PM
  • Thorsten,
     
    If you follow the procedure outlined in Section 2.1 of [MS-OXBBODY] , you are able to determine the best format to use when parsing the message. This same process will also apply to .msg files as well. The steps involved will tell you to check the status of a rop or check a property. You must choose the latter and follow the same logic detailed in the specification.
     
    However, I must also inform you that if these files were generated by Outlook, the format is going to be RTF.
     
    I hope this helps.
     
    Dominic Salemno
    Escalation Engineer
    Open Specifications
     
    • Marked as answer by King Salemno Tuesday, November 16, 2010 8:36 PM
    Tuesday, November 16, 2010 8:36 PM