Graph is returning blank emails with a FolderId that cannot be found (return ErrorItemNotFound)

geetarman 26 Reputation points
2023-01-27T12:31:11.69+00:00

We have an application that is using the graph api to download users emails and then based on the folder location insert the email into a repository. To do this we get the folderid of the email and then get the folder from that id and look at the folderpath to see if it is with a folder that is to be processed. For the vast majority of emails this is working with no problem but with one customer we are getting an error when we try to get the folder back from graph when using the folder id.

The error message is something like this

System.Exception: Unable to retrieve the email! ---> System.AggregateException: One or more errors occurred. ---> Microsoft.Graph.ServiceException: Code: ErrorItemNotFound

Message: The specified object was not found in the store.

<the requestid etc is then displayed etc>

Additionally the email that is being returned is pretty much entirely blank, The subject is null , the To, From,CC,body fields etc are empty. The only thing we have seen that is possibly of interest is that the isDraft property is True. However, we can see nothing in the drafts folder that matches the email (and we can see some emails in the draft folder and these get processed correctly).

We have also written a test application that tries to find the folder from the folderId by iterating though all the users and groups in the tenancy and still cannot find it.

Does anyone have a suggestions as to what this email might be and where it might be located that we cannot access its folder?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,546 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bhanu Kiran 3,526 Reputation points
    2023-04-07T06:47:57.5066667+00:00

    Hi @geetarman , If you are still facing this issue, I would recommend you to raise a support case with Microsoft Graph, a Support Engineer will be able to assist you better. You can raise support ticket from
    http://aad.portal.azure.com/ or https://admin.microsoft.com/#/support/requests. Hope this helps. If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.

    0 comments No comments