Share via

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/******@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": "******@domain.com",
      "name": "Some Service"
    }
  },
  "toRecipients": [
    {
      "emailAddress": {
         "address": "******@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

Exchange Online
Exchange Online

A cloud-based service included in Microsoft 365, delivering scalable messaging and collaboration features with simplified management and automatic updates.

Microsoft Security | Microsoft Graph

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.