none
Activesync 12.0, Retrieve the first 50 mails . RRS feed

  • Question

  • Using the sync command or the search command, is it possible to retrieve the first 50 emails or unread mails from the activesync server.

     

    Just to add the question, I just need to sync the first 50 emails, is there anyway to probably do a sync with windowSize set to 50 and then stop the sync. So after stopping the sync, I want to be able to get folder changes that were made like new email, addition or deletion.

     

    Hope its clear.

    • Edited by IridiumUser Friday, December 30, 2011 8:21 PM
    Friday, December 30, 2011 8:14 PM

Answers

  • Hi IridiumUser, the implementation of custom behavior such as what you are looking for is outside of the scope of the Open Specifications forums. Since there is not a single command that performs the functionality that you are trying to accomplish, how to do that would be an implementation decision that is up to you. However, the workaround that you currently have in place seems reasonable.

     

    Please let me know if you have any other questions about the technical accuracy or clarity of the protocol documentation.


    Josh Curry (jcurry) | Escalation Engineer | Open Specifications Support Team
    Friday, January 6, 2012 4:48 PM
    Moderator

All replies

  • Hi IridiumUser,

    Thanks for your question regarding [MS-ASCMD] and related specifications.  One of the Open Specifications team will respond shortly to assist you.

    Best regards,
    Tom Jebo
    Escalation Engineer
    Microsoft Open Specifications

    Friday, December 30, 2011 8:32 PM
    Moderator
  • Hi IridiumUser, 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. Thank you for your patience.
    Josh Curry (jcurry) | Escalation Engineer | Open Specifications Support Team
    Tuesday, January 3, 2012 8:27 PM
    Moderator
  • Hi IridiumUser. Yes, you can use the WindowSize element to limit the number of items returned in a Sync response. If the server contains more items than the limit you set it will return the MoreAvailable element in the response.  Normally, you would continue to call Sync with the next SyncKey until you retrieve everything. But you don't need to do anything to 'stop' the sync, just don't call Sync again. You could then send a FolderSync request instead.

     

    Please let me know if this helps you.


    Josh Curry (jcurry) | Escalation Engineer | Open Specifications Support Team
    Thursday, January 5, 2012 5:33 PM
    Moderator
  • Hi Josh,

              Thanks for your reply. I tried it out, but what I am looking for is more like the filterType behavior but filterType works by the time period, I wanted it to work by the number of emails.

              So with the filterType, when I do the first sync with filterType set to 1, it retrieves the emails in the last day and then if I do a sync again, it will only retrieve the changes that were done.

              My requirement is similar, I want to be able to retrieve the first 50 emails and then I want to be able to retrieve only the changes that were made to the folder. So if a new email was added to a specific folder, that would be part of the sync response.

             I tried what you had suggested, after the first sync, I had sent a folderSync with the syncId from the first folderSync(initial response). And then I tried the sync again with the last syncId of the sync response. The response was the next 50 messages and not the changes.

          I hope I was clear this time. Thanks for your time.

     

    Addition: 

              One workaround is that I can get the first 50 items and then do another sync with filterType set to 1 and then sync's after that would only give me the changes. By this way , I can avoid having to sync the entire folder. The only problem is the extra sync that I need to do with the filterType.

     

    • Edited by IridiumUser Thursday, January 5, 2012 10:31 PM
    Thursday, January 5, 2012 10:23 PM
  • Hi IridiumUser, the implementation of custom behavior such as what you are looking for is outside of the scope of the Open Specifications forums. Since there is not a single command that performs the functionality that you are trying to accomplish, how to do that would be an implementation decision that is up to you. However, the workaround that you currently have in place seems reasonable.

     

    Please let me know if you have any other questions about the technical accuracy or clarity of the protocol documentation.


    Josh Curry (jcurry) | Escalation Engineer | Open Specifications Support Team
    Friday, January 6, 2012 4:48 PM
    Moderator
  • Thanks josh, That is all I was looking for, if there was a single command that would let me do it.

    Thanks again for your prompt reply.

     

    Friday, January 6, 2012 7:21 PM