"Too many concurrent connections opened." connecting to exchange online with EWS using Microsoft OAuth2

0 votes
asked Jun 24, 2020 by vanchuri (140 points)


Able to successfully connect to outlook/exchange online with EWS using Microsoft Identity Platform.
But getting following exception:
"Too many concurrent connections opened., Cannot open mailbox (ErrorInternalServerError)"

This has started happening when using OAuth, which was not the case with basic authentication.

Also came across following issue, which discusses the same thing. Unable to figure out how to apply the solution on Rebex EWS library?

Can you please help?

Applies to: Rebex Secure Mail

1 Answer

0 votes
answered Jun 24, 2020 by Pavel Matyska (15,060 points)

Update: This has been resolved in Rebex Secure Mail 2020 R4.


I tried to reproduce the issue described in the link you provided, but the issue did not manifest. We did a search what mentioned header "X-AnchorMailbox" from the same link is used for and it turned out it is used when you need to impersonate a user in certain circumstances. See this Microsoft document.

Are you using impersonation? Can you share more information about the issue? How can we reproduce it using our EWS component? Which server you are connecting to?

commented Jun 29, 2020 by Pavel Matyska (15,060 points)

here you can download a trial version of our Secure Mail beta build with support of X-AnchorMailbox header.


please give it a try and let us know whether it helps you.
commented Jun 29, 2020 by vanchuri (140 points)
Thanks Pavel,

Tried with more that 20 connection, i don't see the issue.
Is their any flag which controls adding X-AnchorMailbox header or it will be added always?

How can we continue to use these binaries, as these are trial?
commented Jun 29, 2020 by Pavel Matyska (15,060 points)

the X-AnchoMailbox header is added when impersonation is used. Without impersonation we have no mail address we can provide to the X-AnchorMailbox header value.

If you have active support contract, please let us know on support@rebex.net for full version of this build.
commented Aug 14, 2020 by anonymous

I have run into same issue. Unfortunately the link you provided for beta build is not valid anymore.

Could you please provide a valid link? I really need to solve this issue.

If it helps, i will contact support for full version.

commented Aug 14, 2020 by Pavel Matyska (15,060 points)

I just reenabled the link, so you can download a package again. For the convenience I copy the link in this comment.


Sorry for the inconvenience.