Change the limit for the number of MIME headers

Mark Babayev 226 Reputation points
2024-03-21T10:40:19.2266667+00:00

We have Exchange Server Online When I try to send an email with some headers I receive an error:

Maximum number of headers in one message should be less than or equal to 5

This is an original request:

POST /v1.0/users/mailbox@domain.com/mailFolders/Inbox/messages HTTP/1.1
Host: graph.microsoft.com
Content-Type: application/json
Authorization: Bearer .....

{
  "body": {
    "contentType": "html", content: "...."
  },
  "subject": "Welcome",
  "from": {
    "emailAddress": {
      "address": "service@domain.com",
      "name": "Some Service"
    }
  },
  "toRecipients": [
    {
      "emailAddress": {
         "address": "service2@domain.com",
         "name": "Another Service"
       }
    }
  ],
   "internetMessageHeaders": [
    {
      "name": "x-eopattributedmessage",
      "value": "0"
    },
    {
      "name": "x-ms-publictraffictype",
      "value": "Email"
    },
    {
      "name": "x-ms-traffictypediagnostic",
      "value": "BL6PEPF0001AB72:EE_|LV3PR06MB9551:EE_"
    },
    {
      "name": "x-ms-office365-filtering-correlation-id",
      "value": "2a4037e0-4f02-43dd-65e9-08dc49794f8e"
    },
    {
      "name": "x-microsoft-antispam",
      "value": "BCL:3;"
    },
    {
      "name": "x-originatororg",
      "value": "domain.com"
    }
  ],
}

When I set the headers number to 5 an email is sent. How can I increase the headers limit in MSGraph API request?

As far, the only source I found was, but it states how to increase the headers limit for local server: https://admx.help/?Category=Office2016&Policy=outlk16.Office.Microsoft.Policies.Windows::L_ChangethelimitMIMEheaders

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,003 questions
Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,519 questions
{count} votes

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.