Why return incorrect email address format from OutLook when getting from Graph SDK?

Jackie Dinh 20 Reputation points
2025-06-05T06:41:44.27+00:00

This is the result that I try to get from Microsoft Graph SDK By using this API https://graph.microsoft.com/v1.0/me/messages/AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAASoXUT3AAA=
Value obtained from graph:

"sender":{      
     "emailAddress":{ 

                "name":"Adele Vance", 

                "address":"/O=EXCHANGELABS/OU=EXCHANGE ADMINISTRATIVE GROUP   
     (FYDIBOHF23SPDLT)/CN=RECIPIENTS/CN=06CCDC60A87A4DA8B961910A1A0C8C22-03B298BA-05" 

     }
 }

What is this and how to convert it to email address? /O=EXCHANGELABS/OU=EXCHANGE ADMINISTRATIVE GROUP (FYDIBOHF23SPDLT)/CN=RECIPIENTS/CN=06CCDC60A87A4DA8B961910A1A0C8C22-03B298BA-05

Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Accepted answer
  1. Azar 29,520 Reputation points MVP Volunteer Moderator
    2025-06-05T07:57:27.19+00:00

    Hi there Jackie Dinh

    Thanks for using QandA platform

    This is an Exchange LegacyDN format, not a standard email address. \i think when the sender's address is from an on-premises environment and isn't properly resolved.

    try using the sender.emailAddress.address field after enabling InternetMessageHeaders, or use the Graph API /users/{id} or /contacts lookup by LegacyDN .

    If this helps kindly accept the answer thanks much.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Vasil Michev 119.5K Reputation points MVP Volunteer Moderator
    2025-06-05T07:27:09.11+00:00

    This is the LegacyExchangeDN, used internally by Exchange. It's also used by Outlook for replying to messages, and common cause of IMCAEX-related NDRs.

    It's perfectly valid for sending messages via Exchange Online, including via the Graph API's methods. But the attribute itself is not exposed via the Graph API methods, such as /me or /users, so you cannot use the Graph to convert it to a "regular" email address. The only supported method to do that would be Exchange PowerShell, where you can query for recipients based on the LegacyExchangeDN value, and then "resolve" it to one of the email addresses:

    Get-Recipient "LegacyExchangeDN " | select -ExpandProperty EmailAddresses
    

    If you want to learn more about this attribute, here's a nice article from Michel: https://www.enowsoftware.com/solutions-engine/exchange-center/bid/151745/the-attribute-the-myth-the-legacyexchangedn


Your answer

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