Hi @ktoa
Thank you for reaching out to Microsoft Learn Q&A!
Based on your description, I understand that your JavaMail application experiences slower performance when retrieving emails via IMAP from Exchange Online, especially as the mailbox size increases.
From my research, one possible explanation for this behavior is the throttling policy applied in Exchange Online. This policy is enforced per mailbox and is designed to manage resource consumption, prevent system overload, and ensure stable performance for all users and applications.
Server-side considerations:
To check the server side: In order to examine the throttling policy applied to IMAP in Exchange Online, you’ll need to contact Microsoft Support by opening a support ticket via the Microsoft Admin Center or by calling the Support Number. This is in line with the guidance provided in the referenced thread: is any option to change imap throttling policy? - Microsoft Q&A
Client-side suggestions:
To improve performance on the JavaMail side, you might consider adding the following properties to your application:
props.setProperty("mail.imaps.partialfetch","false");
props.setProperty("mail.imaps.fetchsize", "1048576"); // or higher
These settings can help optimize how messages are fetched, especially for larger mailboxes.
Reference: java - Setting the "mail.imaps.fetchsize" property to a large number using JavaMail have any impact…
Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.
If the issue persists after trying the above methods, could you kindly share any screenshots of the error codes or messages you're encountering?
It would help me better understand your situation.
Please know that while our initial response might not resolve the issue right away, your input is incredibly valuable. With a bit more detail, we’ll work together to find the best solution for you.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.