Is there a way to get the email aliases address to which an email was originally sent from Microsoft Graph?
We have a single email account like main@company.com
along with the multiple other associated email addresses (email aliases). Emails send to any of the aliases go to a to the same inbox as main@company.com
.
If we send an email to alias@company.com
and look at the message using https://graph.microsoft.com/v1.0/me/messages
, it shows mail@company.com
as the email address. We need to detect if it was sent to alias@company.com
.
The information for the allies can be found in the email header and there is a potential workaround in the Outlook API:
https://outlook.office.com/api/v2.0/me/mailfolders/inbox/messages/{messageId}?$select=Subject,SingleValueExtendedProperties &$expand=SingleValueExtendedProperties($filter=PropertyId eq 'String 0x7D')
This returns an unstructured result which needs to be parsed and it is not very convenient. We are looking if there is a more direct way to get this from Microsoft Graph.