PGP + Graph API + 4MB limit

Dev 6 Reputation points
2022-06-16T11:44:37.833+00:00

The 4MB size limit on sending mime messages breaks PGP functionality.

You can attach encrypted + signed messages using separate attachments, but I can't find any workaround for large signed emails that exceed 4MB in size since any change to the mime structure will break PGP signature verification. Any known workarounds? Any other APIs that can be used to send large mime emails?

Why is there such an arbitrary limit?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,794 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Glen Scales 4,441 Reputation points
    2022-06-16T23:45:03.403+00:00

    4Mb in the maximum size for the JSON document the server will accept, I believe its a standards reason and most JSON parsers have this limitation eg https://www.ibm.com/docs/en/datapower-gateway/10.0.1?topic=20-json-parser-limits

    EWS or SMTP would be the other solutions as they aren't going to have that restriction.

    0 comments No comments

  2. Dev 6 Reputation points
    2022-06-17T06:27:06.167+00:00

    Hi Glen, there is an api endpoint for large attachments that accepts files upto 150MB in size. There should be an equivalent endpoint for large mime emails. There was one in the old outlook api.

    We also can't send using EWS since you can only get access to one resource per access token - so we can't combine using graph + ews.

    SMTP is disabled by a lot of tenants by default - so even if I use that scope, it has a high failure rate.

    EWS is deprecated now and we're trying to migrate to Graph but not being able to send large mime emails is a big drawback.

    Any other ideas?


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.