MailKit Extension shows "Loading..." longer than usual esp. for emails with attachments

Number:rdar://FB12796974 Date Originated:2023-07-30
Status:Investigating Resolved:
Product:macOS Mail Product Version:
Classification:Bug Reproducible:
I'm developing a MailKit Mail Extension using the MEMessageSecurityHandler capability and after enabling it and selecting a message, it takes longer than usual to display it, sometimes taking over 10 seconds to display (especially on e-mails that include attachments). I noticed this happens even with the sample WWDC21 MailKit app/Mail Extension, which is odd because there isn't any long-running functions in the code. Disabling all Mail Extensions allow selected messages to be displayed nearly instantly as expected. To try to reproduce: 1. build and run 2. Goto Mail > Settings > Extension > check: SampleMailExtensions 3. select an email with an attachment 4. "Loading..." spinner appears in the Message viewer and takes over 10 seconds on most (but not all) Macs I've tried before the body is displayed

Ventura 13.5



Yep, this is still an issue with 14.3. My last reply from Apple in January about this issue suggested it could be a performance issue with my MEMessageSecurityHandler extension but this definitely happens with Apple's sample extension code.


By sebastienboisvert at March 5, 2024, 12:50 a.m. (reply...)

another MailKit developer

Seems under 14.3 this is still slow.

Note that connectivity issues with either the machine's internet connection, or at the email server level can make this worse (since the responses are even slower); fixing those connectivity issues can help, but large messages (especially those with attachments) will always seem slower since Mail always re-fetches the entire message from the server (instead of using the local cached copy) when any extension is enabled.

By sebastienboisvert at Feb. 13, 2024, 5:18 p.m. (reply...)

another MailKit developer

Unverified: looks like 14.2 improves on this dramatically; still occurs if the account(s) are in offline mode, but doesn't lag anymore in normal use (compared to a VM of 14.1.2).

By sebastienboisvert at Dec. 6, 2023, 9:15 p.m. (reply...)

From Apple

"Mail seems to be calling into the extension multiple times. We are tracking this internally"

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!