Using the Tag for external email messages received feature in the Microsoft Graph and Exchange Web Services
The "Tag for external email messages received" feature was introduced into Office365 recently to help people better to identify mail that comes from external sender vs internal sender see this for more info on this feature .
What happens when you enable this feature is that for messages with External sender a new Mapi property is set on those messages eg
For messages from internal senders the property doesn't appear to get set and if the feature isn't enabled in your tenant then you won't see this property either. You can negate the boolean value of the property which will turn off the external tag.
This property is set-able so if you have an application where email is marked as external and you can't or don't want to whitelist the domain (so they no longer are marked external) you could modify this property value (on each applicable message) so they will no-longer be tagged as External for the user.
What happens when you enable this feature is that for messages with External sender a new Mapi property is set on those messages eg
For messages from internal senders the property doesn't appear to get set and if the feature isn't enabled in your tenant then you won't see this property either. You can negate the boolean value of the property which will turn off the external tag.
Using it in the Microsoft Graph API
If you want to use it in the Microsoft Graph API when you retrieve messages you can include this as a SingleValueExtendedProperties eg for Retrieving and filtering message you can use
In EWS you can use a SearchFilter eg
I've included this in my Get LastEmail 101 graph sample if you want to try this in a real mailbox eg you can do
Get-LastEmail -InternalSender -MailboxName gscales@mailbox.com
Will get the Last mail from an Internal Sender
Get-LastEmail -ExternalSender -MailboxName gscales@mailbox.com
Will get the Last mail from an External Sender
and you can use the -Focused or -Other switch to get the above email from the Focused or Other Inbox
Using it in Exchange Web Services
In EWS you can use a SearchFilter eg
This property is set-able so if you have an application where email is marked as external and you can't or don't want to whitelist the domain (so they no longer are marked external) you could modify this property value (on each applicable message) so they will no-longer be tagged as External for the user.