[jira] [Closed] (JAMES-4150) Make Attachment Storage Optional for PostgreSQL Message Store

"Benoit Tellier (Jira)" <[email protected]> Fri, 13 Mar 2026 21:51:00 +0000 (UTC)
Newsgroups gmane.comp.jakarta.james.devel
Message-ID <[email protected]>
     [ https://issues.apache.org/jira/browse/JAMES-4150?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benoit Tellier closed JAMES-4150.
---------------------------------
    Resolution: Fixed

Merged at https://github.com/apache/james-project/pull/2919

Thanks for the contribution

> Make Attachment Storage Optional for PostgreSQL Message Store
> -------------------------------------------------------------
>
>                 Key: JAMES-4150
>                 URL: https://issues.apache.org/jira/browse/JAMES-4150
>             Project: James Server
>          Issue Type: Improvement
>          Components: Blob, jpa
>    Affects Versions: 3.9.0
>            Reporter: omerfarukicen
>            Priority: Critical
>             Fix For: 3.9.0
>
>         Attachments: Dispatch
>
>          Time Spent: 2h 10m
>  Remaining Estimate: 0h
>
> [https://github.com/apache/james-project/tree/postgresql]
> Apache James Distributed  -> Postgresql branch 
> Related Epic: JAMES-3226 (Postgres message store)
> When a Dispatch(ek-1) message contains multiple parts, all parts are currently stored in ObjectStorage and also persisted in the {{attachment}} table.
> However, since we are using JMAP, these parts are already represented as “virtual parts,” making the extra ObjectStorage write redundant.
> In the JPA project, this behavior is configurable and can be disabled.
> But in the PostgreSQL project, it is currently mandatory.
> To align the PostgreSQL behavior with JPA and to avoid unnecessary storage operations, we should make attachment storage {*}optional{*}.
> Introduce a configuration option (e.g., {{{}attachmentStorageEnabled{}}}) to enable or disable attachment persistence for PostgreSQL.
> When disabled, attachments should not be stored in ObjectStorage or the {{attachment}} table.
> {{if (mapperFactory.isAttachmentStorageEnabled()) {
>     return new MessageStorer.WithAttachment...}}



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