0

generally in graph we can obtain the high level details of a folder using folder query and next level details such as the data of emails were obtained using message query usually the high level data such as child folder, total email count and other details we be same as of the actual items present in that folder & the no of messages returned in response with the message query.

but, in come cases the Total message count of a folder obtained with the folder query doesn't match the actual number of messages obtained in the message query within a folder.

I really didn't guess the reason behind this, is there any possible hidden items or any other thing that isolates set of emails which is not included in any of the responses & not viable in outlook.

I'd like to share the response of one of my folder that falls within the above case I mentioned. the reference folder attached is discoveryholds under recoverable items which is not actually seen by users in outlook. but, I also see this same issue in deleted items of many of my mailboxes within my tenant.
below is the response obtained for the

request on folder details with folder queryenter image description here

request on details of messages with in the folder with count based on
enter image description here the above response is obtained from which seems to be correct while I manually counted it.

https://graph.microsoft.com/beta/me/mailFolders/recoverableitemsdiscoveryholds/messages?$count=true

It would be helpful if I know the reason behind this. Thanks in advance.

2
  • The folder "recoverableitemsdiscoveryholds" is a system folder that is used by Exchange for discovery searches and holds. It is possible that there are hidden or deleted items in this folder that are not visible to users in Outlook, but are still included in the actual number of messages obtained from the message query. Commented Jun 5, 2024 at 7:26
  • Special folders such as recoverableitemsdiscoveryholds might include system-generated items, such as metadata or placeholder messages, that are counted in the folder’s total but not retrieved in standard message queries. Commented Jun 5, 2024 at 7:27

1 Answer 1

0

Initially for sample, I ran the same query as below:

https://graph.microsoft.com/beta/me/mailFolders/

enter image description here

When I ran the query to get the individual folder messages, I got the same number:

https://graph.microsoft.com/beta/me/mailFolders/Inbox/messages?$count=true

enter image description here

In your scenario, as you are querying recoverableitemsdiscoveryholds which is a system folder that is used by Exchange for discovery searches and holds, hence it is possible that there are hidden or deleted items in this folder that are not visible in Outlook but are still included in the actual number of messages obtained from the message query.

  • Special folders such as recoverableitemsdiscoveryholds might include system-generated items, such as metadata or placeholder messages, that are counted in the folder’s total but not retrieved in standard message queries.
  • In Exchange, by default there are special folders that only Microsoft uses internally. They're hidden from everyone else, but you can still find out how many items are in them.
  • To confirm this, try to query any other folder to verify whether the value matches.

You can also try Get-MailboxStatistics command to check the message in the mail folder.

Sign up to request clarification or add additional context in comments.

16 Comments

In case of recoverableitemsdiscoveryholds it may be, but I have also seen the same case in Deleted Items folder which is not a special folder and just contains the items deleted by the user and this made me think that this might be also be seen in normal outlook default folders such as Inbox, sent Items etc. which I haven't encountered it yet.
Did you face the same issue with inbox folder?
nope, but I think if it is possible for deleted items folder then it might be same for inbox.
Can you please check and confirm?
I have replaced the graph query reference attachment on discoveryholds with deleted items. I have around 25 mailboxes in my test tenant and more than 10 of the mailboxes contains deleted items under the mentioned case and some mailboxes also have recoverableitemsdiscoveryholds, recoverableitemsversions, recoverableitempurges under this case and no other folders has this issue in my tenant and this doesn't conclude no folders other than this contains this count mismatch which brought me here!
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.