none
Cross-mailbox Item Move fails - The specified object was not found in the store. RRS feed

  • Question

  • An application is sending an email message to a temporary mailbox and upon successful arrival, moves it to another mailbox's known folder.

    * Application used 14.2.51.0 and 14.03.0032.000 Microsoft.Exchange.WebServices.dll.
    * Application ran on Exchange Server 2007 SP1 and 2010 SP1.
    * Impersonator account is the same for both temporary and final mailboxes.
    * The impersonator and the account running the application are the same.
    * The account running the application has full access permission on both mailboxes.
    * The same scenario works properly via direct EWS, but our preference is to use Managed API.
    Tuesday, May 22, 2012 1:17 PM

Answers

All replies

  • -----------------------APP code-----------------

     public string Move(WellKnownFolder rootFolder, string mailboxSmtp)
      {
       mailboxSmtp = ParamUtils.BlankThrow(mailboxSmtp, "mailboxSmtp");

       logger_.Debug("Moving message into [{0}] mailbox [{1}] root folder...", mailboxSmtp, rootFolder);

       try
       {
        FolderId fid = new FolderId(EwsWellKnownFolder.Get(rootFolder), mailboxSmtp);
        Item movedItem = message_.Move(fid);

        //NOTE: move between mailboxes does not return moved item ID
        string id = movedItem != null && movedItem.Id != null
         ? movedItem.Id.UniqueId
         : null;

        logger_.Info("Moved message into [{0}] mailbox [{1}] root folder. ID: [{2}].", mailboxSmtp, rootFolder, id ?? "N/A");

        return id;
       }
       catch (Exception ex)
       {
        throw new EwsException(
         "Failed to move the message due to: {0}",
         ex,
         ex.Message);
       }
      }

    -----------------------EWS trace log-----------------

    <Trace Tag="EwsRequest" Tid="1" Time="2012-05-21 13:36:50Z" Version="14.03.0032.000">
      <?xml version="1.0" encoding="utf-8"?>
      <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
        <soap:Header>
          <t:RequestServerVersion Version="Exchange2007_SP1" />
          <t:TimeZoneContext>
            <t:TimeZoneDefinition Id="Pacific Standard Time" />
          </t:TimeZoneContext>
          <t:ExchangeImpersonation>
            <t:ConnectingSID>
              <t:PrimarySmtpAddress>UMbx_1@testlab.com</t:PrimarySmtpAddress>
            </t:ConnectingSID>
          </t:ExchangeImpersonation>
        </soap:Header>
        <soap:Body>
          <m:GetItem>
            <m:ItemShape>
              <t:BaseShape>AllProperties</t:BaseShape>
            </m:ItemShape>
            <m:ItemIds>
              <t:ItemId Id="AAMkAGRjNjJjMTliLWM3ZTUtNDVhZC1iYjkyLWExYTg1ZjQ0MjZiNgBGAAAAAACsADMddV0oTIvdjHLSGJcPBwDbR8y12RQtRaxg/ZY/sc9cAAAC8npnAADbR8y12RQtRaxg/ZY/sc9cAAAC8nqeAAA=" />
            </m:ItemIds>
          </m:GetItem>
        </soap:Body>
      </soap:Envelope>
    </Trace>
    2012-05-21 06:36:50 - EwsResponseHttpHeaders
    <Trace Tag="EwsResponseHttpHeaders" Tid="1" Time="2012-05-21 13:36:50Z">
    200 OK
    Transfer-Encoding: chunked
    Content-Encoding: gzip
    Vary: Accept-Encoding
    Persistent-Auth: true
    Cache-Control: private
    Content-Type: text/xml; charset=utf-8
    Date: Mon, 21 May 2012 13:36:50 GMT
    Server: Microsoft-IIS/7.5
    X-AspNet-Version: 2.0.50727
    X-Powered-By: ASP.NET


    </Trace>
    2012-05-21 06:36:50 - EwsResponse
    <Trace Tag="EwsResponse" Tid="1" Time="2012-05-21 13:36:50Z" Version="14.03.0032.000">
      <?xml version="1.0" encoding="utf-8"?>
      <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
        <s:Header>
          <h:ServerVersionInfo MajorVersion="14" MinorVersion="1" MajorBuildNumber="355" MinorBuildNumber="2" Version="Exchange2010_SP1" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
        </s:Header>
        <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
          <m:GetItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
            <m:ResponseMessages>
              <m:GetItemResponseMessage ResponseClass="Error">
                <m:MessageText>The specified object was not found in the store.</m:MessageText>
                <m:ResponseCode>ErrorItemNotFound</m:ResponseCode>
                <m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
                <m:Items />
              </m:GetItemResponseMessage>
            </m:ResponseMessages>
          </m:GetItemResponse>
        </s:Body>
      </s:Envelope>
    </Trace>


    Tuesday, May 22, 2012 1:20 PM
  • The trace you've posted is using Impersonation so from a security context the only Rights that this code will have are the rights assigned to the account your impersonating eg UMbx_1@testlab.com.

    So for the Move (or the GetItem) to work from a security point of view when using Impersonation UMbx_1@testlab.com would need to access to the source and destination folders. That error your getting would indicate that the UMbx_1@testlab.com doesn't have access to the Item or the Item has been moved (Eg an Inbox rule has acted on it etc).

    > * The account running the application has full access permission on both mailboxes.
    > * The impersonator and the account running the application are the same.

    If that's the case don't use impersonation just use delegate access and then the rights that will matter are rights assigned to your service account.

    Cheers
    Glen

    Wednesday, May 23, 2012 6:34 AM
  • Many thanks Glen.

    I tried a number of scenarios between temporary and final mailboxes and they did not work.

    I went with the "no impersonation" + "delegate access" option and it worked!

    Can you please point me to an official documentation about permission/access prerequisites for EWS in general?

    Thursday, May 24, 2012 2:23 PM
  • I'd suggest reading http://blogs.msdn.com/b/exchangedev/archive/2009/06/15/exchange-impersonation-vs-delegate-access.aspx which is probably about the most readable thing on this subject and links to the official documentation.

    Cheers
    Glen

    Friday, May 25, 2012 4:51 AM
  • Thanks a lot, Glen.
    Friday, May 25, 2012 11:19 AM
  • I was attempting to move an email message from the Inbox to a folder I had created. The move was being done by way of a vb.net application. I was able to resolve the issue simply by changing authority on the Inbox making it the 'Owner'.

    1. Right click on the 'Inbox'.

    2. Select Properties.

    3. Select Permissions.

    4. Under the drop-down list for 'Permission Level', Select 'Owner'.

    5. Hit 'Apply', then 'OK'.

    The message 'The specified object was not found in the store' no longer comes up.


    Friday, September 6, 2013 1:56 PM