Search code examples
microsoft-graph-apispambulk-email

Msgraph set notificationQueryOptions to avoid Bulk emails


I know that Microsoft 365 has a filter for Bulk email and in the Email Header there is a code called Bulk complaint level (BCL):

X-Microsoft-Antispam: BCL:0;

0 ->The message isn't from a bulk sender.
1, 2, 3 ->The message is from a bulk sender that generates few complaints.
4, 5, 6, 7* -> The message is from a bulk sender that generates a mixed number of complaints.
8, 9 ->The message is from a bulk sender that generates a high number of complaints.

I am trying to set a filter when I create the Subscription to receive notification only when a non Bulk Email is received(BLC: 0)

{
    "changeType": "created",
    "resource": "me/mailFolders('Inbox')/messages",
    "clientState": "secret",
    "notificationUrl": "https://...",
    "notificationQueryOptions": "$filter = X-Microsoft-Antispam eq BCL:0",
    "expirationDateTime": "2021-09-12T22:42:09Z"
}

but it doesn't seem to work


Solution

  • Ok, it is not possible since the notificationQueryOptions supports only Universal Print Service resource.