Incomplete retrieval of recursive .msg attachmenst via Microsoft Graph API

Rens Rijvers 0 Reputation points
2025-10-27T07:13:23.8833333+00:00

Hey,

i have a question about regarding to Graph API and retrieving emails and their attachments.

Case Description

An email (Email A) contains an attachment in .msg format (Email B). Email B itself also contains another .msg attachment (Email C). The goal is to recursively retrieve all attachments starting from Email A, including their extended MAPI properties. Two Microsoft Graph API calls are used:

  • Call 1:

GET https://graph.microsoft.com/v1.0/{userId}/messages/{messageId}/attachments?$expand=microsoft.graph.itemAttachment/item

  • Call 2:

GET https://graph.microsoft.com/v1.0/{userId}/messages/{messageId}/attachments/{attachmentId}?$expand=microsoft.graph.itemAttachment/item

Environment

  • Graph API, reproducible via the graph explorer.
  • Requires a messageId referencing an email with nested .msg attachments

Expected behavior

  • All attachments should be retrieved recursively.
  • Each item object should include a valid id.
  • Extended MAPI properties should be present for all nested attachments, consistent with the metadata available in Email A.

Current behavior

  • Both API calls return item objects with missing id fields.
  • Extended MAPI properties are not included in the response for nested .msg attachments.

Steps to reproduce

  1. Create an email (Email A) with a .msg attachment (Email B), which itself contains another .msg attachment (Email C) with extended properties.
  2. Execute the following API call: GET https://graph.microsoft.com/v1.0/{userId}/messages/{messageId}/attachments?$expand=microsoft.graph.itemAttachment/item
  3. Observe that the response contains: "item": { "id:" "" } for all attachments and lacks extended MAPI properties.

Context

There is a requirement to retrieve extended properties from .msg attachments.

Thanks you for your time, Rens Rijvers

Microsoft Security | Microsoft Graph
0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.