[jira] [Resolved] (JAMES-4190) Read only Mailbox annotation

René Cordier (Jira) <[email protected]> Mon, 16 Mar 2026 02:55:00 +0000 (UTC)
Newsgroups gmane.comp.jakarta.james.devel
Message-ID <[email protected]>
     [ https://issues.apache.org/jira/browse/JAMES-4190?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

René Cordier resolved JAMES-4190.
---------------------------------
    Fix Version/s: 3.9.0
       Resolution: Done

Was done by https://github.com/apache/james-project/pull/2975

> Read only Mailbox annotation
> ----------------------------
>
>                 Key: JAMES-4190
>                 URL: https://issues.apache.org/jira/browse/JAMES-4190
>             Project: James Server
>          Issue Type: Improvement
>          Components: IMAPServer, mailbox
>            Reporter: Benoit Tellier
>            Priority: Major
>             Fix For: 3.9.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> ## Why
> As an extension writer I need to expose server side computed metadata and I do not want IMAP clients to mess up with this.
> Propose a modular way to define read only annotation from the IMAP client
> ## What                                                                                                                                                                                                      
>    
> Some metadata entries are computed server-side and must be exposed to clients as read-only: GETMETADATA must return them, but SETMETADATA must respond NO with an appropriate error message. Currently    
> nothing prevents a client from overwriting any annotation. A modular extension point is needed so that any module (quota, ACL, vendor extensions…) can declare which annotation keys it owns and are not
> client-writable.
> ## How
> Introduce a `ReadOnlyAnnotationPredicate` interface with a single method `boolean isReadOnly(MailboxAnnotationKey key).` Modules register implementations via Guice multibinding. A composite
> AggregatedReadOnlyAnnotationPredicate ORs all registered predicates together and is injected into StoreMailboxAnnotationManager. In updateAnnotationsReactive(), before canInsertOrUpdate, each incoming
> annotation key is tested — a match throws AnnotationException("annotation is read-only: <key>"), which SetMetadataProcessor already maps to an IMAP NO response. Server-side writers bypass this by
> calling AnnotationMapper directly, which is intentional.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)