nextcloud / nextcloud/mail

JMAP Write Operations

Open
#12,611 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop enhancement
Dominant language
JavaScript
Stars
1k
Forks
348
Avg merge
12h 28m
Merged PRs (30d)
91

Description

Summary

Implement write operations for JMAP accounts: flag changes, move, copy, and delete.

Problem

JMAP accounts are read-only without write operations. Users cannot change flags, organize messages,
or delete mail.

Solution

  • Implement flag operations using JMAP Message/Email API
  • Implement move/copy using JMAP mailboxIds property
  • Implement delete
  • Ensure all operations work identically to IMAP operations from user perspective

Implementation

Extend lib/JMAP/ namespace with operations:

  • Operation implementations for flag changes, move, copy, delete
  • Reuse existing service layer abstractions via dispatcher pattern

JMAP-specific details:

  • Flags use JMAP keywords property (no separate read/unread flag)
  • Move uses mailboxIds (JMAP allows multi-mailbox; simulate single mailbox behavior)
  • Copy adds mailbox ID to mailboxIds
  • Delete moves to trash or sets destroyed flag

Service layer remains protocol-agnostic via dispatcher pattern.

Error handling catches JMAP errors and translates to service exceptions.

Affected Components

  • lib/JMAP/: operation implementations
  • Existing service layer: use dispatcher or extend as needed

Acceptance Criteria

  • Flag operations (read/unread, custom flags) work for JMAP accounts
  • Move/copy/delete operations work for JMAP accounts
  • Operations persist on server
  • Operations sync back correctly on next sync
  • Behavior matches IMAP for equivalent operations

Out of Scope

  • UI changes
  • JMAP-specific optimizations

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the existing operations and service-layer abstractions under lib/JMAP/, then trace how the dispatcher connects protocol operations to IMAP behavior. Implement flag changes, move, copy, and delete using the stated JMAP properties and error translation approach. Done means the operations persist, sync on the next sync, and match equivalent IMAP behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.