Create an override for a sender identified by an SMTP address. Future messages from that SMTP address will be consistently classified
as specified in the override.
Note
If an override already exists with the same SMTP address, then the classifyAs and name fields of that override are updated with the provided values.
The maximum number of overrides supported for a mailbox is 1000, based on unique sender SMTP addresses.
The POST operation supports creating only one override at a time.
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new InferenceClassificationOverride
{
ClassifyAs = InferenceClassificationType.Focused,
SenderEmailAddress = new EmailAddress
{
Name = "Samantha Booth",
Address = "samanthab@adatum.onmicrosoft.com",
},
};
var result = await graphClient.Me.InferenceClassification.Overrides.PostAsync(requestBody);
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new InferenceClassificationOverride();
$requestBody->setClassifyAs(new InferenceClassificationType('focused'));
$senderEmailAddress = new EmailAddress();
$senderEmailAddress->setName('Samantha Booth');
$senderEmailAddress->setAddress('samanthab@adatum.onmicrosoft.com');
$requestBody->setSenderEmailAddress($senderEmailAddress);
$result = $graphServiceClient->me()->inferenceClassification()->overrides()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Mail
$params = @{
classifyAs = "focused"
senderEmailAddress = @{
name = "Samantha Booth"
address = "samanthab@adatum.onmicrosoft.com"
}
}
# A UPN can also be used as -UserId.
New-MgUserInferenceClassificationOverride -UserId $userId -BodyParameter $params
# THE PYTHON SDK IS IN PREVIEW. FOR NON-PRODUCTION USE ONLY
graph_client = GraphServiceClient(request_adapter)
request_body = InferenceClassificationOverride(
classify_as = InferenceClassificationType.Focused,
sender_email_address = EmailAddress(
name = "Samantha Booth",
address = "samanthab@adatum.onmicrosoft.com",
),
)
result = await graph_client.me.inference_classification.overrides.post(body = request_body)