perf(icloud): respect iCloud Mail IMAP connection & message-size limits #363

Closed
opened 2026-07-05 22:24:18 +00:00 by JMR-dev · 0 comments
JMR-dev commented 2026-07-05 22:24:18 +00:00 (Migrated from github.com)

Context

LibreMail is an offline-first Android email client. IMAP is currently connect-per-operation (connection reuse, issue #125, is OFF by default); full-history backfill (issue #12) prefetches message bodies + attachments on unmetered networks (default FetchPolicy.WIFI_ONLY). A perf drilldown found this opens roughly 1 + K + attachments separate authenticated connections per backfill page, saturating a provider's connection/bandwidth budget and starving interactive message-opens. These tickets track making LibreMail's connection/request patterns and data usage respect each major provider's documented limits and degrade gracefully under throttling. (Outlook/Hotmail uses the Microsoft Graph REST API; Gmail, Yahoo/AOL, and iCloud use IMAP/SMTP.)

Documented limits

  • 5-8 concurrent connections per account.
  • 20 MB max message size (unless Mail Drop).
  • SMTP: 1,000 messages/day, 1,000 recipients/day, 500 recipients/message.
  • App-specific password required (standard passwords rejected over IMAP).

Optimization levers

  • Cap concurrent connections at 5 or fewer.
  • Enforce/handle the 20 MB message-size limit on send.
  • Connection reuse.

Depends on

Depends on / see the throttling-backoff umbrella issue #360.

## Context LibreMail is an offline-first Android email client. IMAP is currently connect-per-operation (connection reuse, issue #125, is OFF by default); full-history backfill (issue #12) prefetches message bodies + attachments on unmetered networks (default `FetchPolicy.WIFI_ONLY`). A perf drilldown found this opens roughly `1 + K + attachments` separate authenticated connections per backfill page, saturating a provider's connection/bandwidth budget and starving interactive message-opens. These tickets track making LibreMail's connection/request patterns and data usage respect each major provider's documented limits and degrade gracefully under throttling. (Outlook/Hotmail uses the Microsoft Graph REST API; Gmail, Yahoo/AOL, and iCloud use IMAP/SMTP.) ## Documented limits - 5-8 concurrent connections per account. - 20 MB max message size (unless Mail Drop). - SMTP: 1,000 messages/day, 1,000 recipients/day, 500 recipients/message. - App-specific password required (standard passwords rejected over IMAP). ## Optimization levers - Cap concurrent connections at 5 or fewer. - Enforce/handle the 20 MB message-size limit on send. - Connection reuse. ## Depends on Depends on / see the throttling-backoff umbrella issue #360.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: JMR-dev/LibreMail#363