Read-only JMAP Support
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1k
- Forks
- 348
- Avg merge
- 12h 28m
- Merged PRs (30d)
- 91
Description
Summary
Implement read-only JMAP support: connect to JMAP servers, sync mailbox structure, and fetch messages.
Problem
Users with JMAP-enabled accounts cannot access their mail via Nextcloud Mail.
We need to add JMAP as a supported protocol with feature parity to IMAP for reading mail.
Solution
- Create JMAP client factory using SebastianKrupinski/jmap-client-php
- Implement mailbox structure sync and conversion to domain models
- Implement message fetching and conversion to domain models
- Handle JMAP Session endpoint discovery and state-based sync
- Ensure output uses same domain models as IMAP
Implementation
Create lib/JMAP/ namespace for JMAP-specific logic:
JmapClientFactory- creates and configures JMAP clientJmapMailboxMapper- converts JMAP Mailbox objects to domain modelsJmapMailboxSync- syncs folder structure into databaseJmapMessageMapper- converts JMAP Message objects to MessageDTOJmapSync- orchestrates message sync using JMAP state tokens
Credential handling reuses existing encryption patterns.
Session discovery fetches .well-known/jmap for JMAP capabilities.
Sync strategy:
- Full sync on first run
- Incremental sync using JMAP state tokens on subsequent runs
- Detects new/changed/deleted messages
Message extraction:
- Headers (To, From, Subject, Date, Message-ID, References, In-Reply-To)
- Flags and keywords
- Attachment metadata
- Message IDs for threading
Affected Components
- New:
lib/JMAP/directory with mappers and sync logic ProtocolClientFactory: register JmapClientFactory (from https://github.com/nextcloud/mail/issues/12609)SyncService: use dispatcher to call appropriate synccomposer.json: add SebastianKrupinski/jmap-client-php dependency
Acceptance Criteria
- JMAP accounts can be created (via https://github.com/nextcloud/mail/issues/12609 infrastructure)
- Connection test validates JMAP server availability
- Mailbox structure syncs correctly
- Messages fetch with all required properties
- Output matches IMAP mapper format (same domain models)
- Existing IMAP sync unaffected
Out of Scope
- Message mutations (flags, move, delete) - see https://github.com/nextcloud/mail/issues/12611
- UI changes - see https://github.com/nextcloud/mail/issues/12612
- Auto-detection
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the existing IMAP sync and mapper flow, then inspect ProtocolClientFactory, SyncService, composer.json, and the proposed lib/JMAP/ namespace. Confirm how the JMAP client dependency, session discovery, state-based synchronization, and domain model conversions fit the existing flow. Done means read-only JMAP accounts sync mailboxes and messages with the same models while IMAP behavior remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- api, backend, database
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100