none
Can we distinguish between draft messages and normal messages in Exchange Activesync protocol. RRS feed

  • Question

  • Hi,

    I am implementing a mobile client to sync Exchange mails to the mobile device.I am using the Microsoft Exchange Activesync protocol to implement the same.

    We have implemented draft folder sync. So the mails present in server draft folder will be synced to the device.

    Here i have one scenario related to draft messages.

    Using the OWA( outlook web access) or Outlook, we can move Inbox messages to the draft folder.When we open these messages in OWA, which are moved to the draft folder , the message is opened in the view screen.

    Also when we move the draft messages from the draft folder to inbox , and then open those messages from the inbox, the compose screen is shown.

    We are also trying to implement the similar feature for the mobile device.

    But we are not able to find out how to differentiate between draft messages and normal messages when they are synced to the device using activesync protocol.

    Can someone please shed some light on this.

    Regards,

    Deepak Jain 

    Wednesday, May 23, 2012 8:04 PM

Answers

  • Hi Deepak,

    Thank you for your patience. In my previous posting I explained the behavior of the draft messages in Outlook. The ActiveSync protocol doesn’t have the granularity to distinguish whether the message draft or not. The information what is hold by the mfUnsent flag of the PidTagMessageFlags property can’t be mapped to an ActiveSync element.

    How you deal with draft messages and the Drafts folder, it is an implementation detail. Experimenting with Windows Phone 7.5 you can observe:
    Create a draft message in Outlook in the Drafts folder; synchronize the drafts folder on the phone, the message was not sent to the phone.
    In Outlook move the message to another folder (it remains draft); synchronize that folder on the phone, the message was sent to the phone, it looks as a regular message only the From is missing.

    A network capture, as you observed, too, shows that the draft message doesn’t contain the optional <From> element. You might use the absence of the From element as indicator that the message is draft, but this is not part of the ActiveSync protocol.

    Thanks, Vilmos

    Monday, August 6, 2012 7:33 PM

All replies

  • Hi Deepak,

    Thanks for your question.

    Someone from our team will contact you shortly.

    Thanks!


    SEBASTIAN CANEVARI - MSFT Escalation Engineer Protocol Documentation Team

    Thursday, May 24, 2012 4:25 AM
  • Hi Deepak,

    I am the engineer who will be working with you on this issue. I am currently researching the problem and will provide you with an update soon.

    Regards,
    Vilmos Foltenyi - MSFT

    Friday, May 25, 2012 2:45 AM
  • Hi Vilmos/SEBASTIAN,

    Thanks you for the faster response.

    Hope to hear from you. I am also researching the protocol documents to find some details regarding drafts.

    Regards,

    Deepak Jain

     

    Friday, May 25, 2012 7:04 AM
  • Hi Vilmos/SEBASTIAN,

    While going through the sync request reponse using wireshark , i found out that the draft messages synced from the server has no "from" address,

    Can we consider this as a point of difference between normal mails and server draft mails.

    Is there any possibility for a mail to come without the "from" address.

    Can you please check this out.

    Regards,

    Deepak Jain

     

    Wednesday, June 6, 2012 1:59 AM
  • Hi Deepak,

    Thank you for your patience. I‘m still researching your question, I asked other groups, too. Soon I’ll provide you with the finding.

    Thanks, Vilmos

    Monday, June 11, 2012 5:09 AM
  • Hi Deepak,

    The message is a draft one if it is not sent, yet. This fact is marked in the message, in the value of the PidTagMessageFlags property, the mfUnsent flag (0x00000008) is set.

    The usage and meaning of the PidTagMessageFlags and mfUnsent are defined in [MS-OXCMSG] v20120422 section 2.2.1.6.
    When this flag is cleared is described in [MS-OXOMSG] section 3.2.5.1, when the message has been sent.
    An alternative name for the mfUnsent flag can be found in [MS-OXTNEF] section 2.1.3.3.8,it is MSGFLAG_UNSENT, this name is used by the MFCMAPI tool.
    The PidTagMessageFlags property itself is defined in [MS-OXPROPS] section 2.862, its Property ID: 0x0E07 and it has an Alternate name: PR_MESSAGE_FLAGS.

    You can “see” this flag by following these steps:

    • Create a new e-mail message, do not send it. The new message is created in the Drafts folder, you can move it to another folder if you wish.
    • Start the MFCMAPI tool and navigate to the Drafts folder, e.g. by Subject find the message and highlight it.
    • In the lower plane the message will be displayed in an annotated form. Sort by “Property name(s)” and find PR_MESSAGE_FLAGS. The line should look like this, see below.

    Thanks, Vilmos

    • Edited by Vilmos Foltenyi Thursday, June 14, 2012 11:43 PM image was too big
    • Marked as answer by Vilmos Foltenyi Tuesday, June 19, 2012 2:21 AM
    • Unmarked as answer by deepak wince Tuesday, June 19, 2012 11:33 PM
    Thursday, June 14, 2012 11:15 PM
  • Hi Vilmos/SEBASTIAN,

    Thanks for your reply, But your reply is related to some other protocol. I am working on MS- Activesync protocol which enables a client, typically a mobile device, to synchronize and exchange objects with a server. These objects include e-mail messages, Short Message Service (SMS) messages, attachments, folders, contact information, meetings, calendar data, tasks, notes and documents(ref. MS-ASCMD).

    Here while working on Draft folder sync , i came across this problem.

    Hope you don't mind but i unmarked your reply as not an answer as it was related to how message objects are stored on the server.

    Thanks and Regards,

    Deepak 


    Tuesday, June 19, 2012 11:45 PM
  • Hi Deepak,

    Thank you for your patience. In my previous posting I explained the behavior of the draft messages in Outlook. The ActiveSync protocol doesn’t have the granularity to distinguish whether the message draft or not. The information what is hold by the mfUnsent flag of the PidTagMessageFlags property can’t be mapped to an ActiveSync element.

    How you deal with draft messages and the Drafts folder, it is an implementation detail. Experimenting with Windows Phone 7.5 you can observe:
    Create a draft message in Outlook in the Drafts folder; synchronize the drafts folder on the phone, the message was not sent to the phone.
    In Outlook move the message to another folder (it remains draft); synchronize that folder on the phone, the message was sent to the phone, it looks as a regular message only the From is missing.

    A network capture, as you observed, too, shows that the draft message doesn’t contain the optional <From> element. You might use the absence of the From element as indicator that the message is draft, but this is not part of the ActiveSync protocol.

    Thanks, Vilmos

    Monday, August 6, 2012 7:33 PM