JAVAMAIL and Office 365 throttling limit

Hello guys.

Just a quick question. Does any of you already implement openNMS notification with Office 365. I tried to get it working but I’m facing an Exchange online limitation.

On some Events like Node Down or Service down, we send notification to 4 users. Only the first 3 users can get the notification, the last one is refused. It looks this error comes from Office 365 adding new throttling limit.

If an application tries to send more than three messages at the same time by using multiple connections, each connection will receive the following error message:

432 4.3.2 STOREDRV.ClientSubmit; sender thread limit exceeded

So it looks that NMS with JAVAMAIL, instead of opening a connection with the email server and send the first email, close the connection, send the second email and so on … tries to open 4 connections at the same time and send email.

This is causing the first 3 users get the notification and the last one is never receiving it, because it got blocked by Microsoft.

See error I’m getting for the last users that need to be notified.
2022-07-26 10:50:06,730 ERROR [NotificationTask-36] o.o.j.JavaMailer: Java Mailer messaging exception: com.sun.mail.smtp.SMTPSendFailedException: 432 4.3.2 Concurrent connections limit exceeded. Visit Changes in message store and throttling for concurrent connections - Exchange | Microsoft Docs for more information.

Is that possible openNMS work that way by opening multiple connection with the mail server instead of doing it one by one to avoid the throttling limit?

Is there any configuration possible? Parameters?
Thanks

This is one of the reasons that leaving the javamail settings at defaults and using a local postfix instance on your server to relay can help.