Benoit Tellier created JAMES-4103:
-------------------------------------

             Summary: Customize MessageParser
                 Key: JAMES-4103
                 URL: https://issues.apache.org/jira/browse/JAMES-4103
             Project: James Server
          Issue Type: Improvement
          Components: JMAP, mailbox
            Reporter: Benoit Tellier
            Assignee: Antoine Duprat


h3. Why?

Mailbox extract a representation of attachments and store them in a  separated, 
decoded and parsed projection. This mechanism was introduced for "JMAP draft".

However JMAP RFC-8621 did actually expose attachments as part of body structure 
(a subset of body structure) making it hard to make it correspond to the 
"mailbox attachments", resulting in each attachment download downloading the 
all message, parses it, locate the part, then decode it, which is innefficient.

While discussing the topic with Houssem NASRI, I realized the problem is way 
easier flipping it around: it's easie to rework mailbox attachements so that it 
reuse JMAP attachment parsing and assign it an attachmentId that ids exactly 
the blobId that JMAP will later expose as a blobPart.

THough this solution requires:
 - mailbox to somehow depend on JMAP
 - MessageParser to have access to the messageId and pass the attachmentId to 
the Attachment Mapper
 - And finally to attempt mailbox attachment download and fallback if relevant 
to message part download.

It's hacky and might result in bigger code changes if implemented in James, 
which is overkill for an experiment.

That's why I would like to be able to do such changes in Twake mail, experiment 
it and validate it before proposing it to the wider community.

h3. How?

Turn Message Parser as an interface. Then I can provide my own.

Create a AttachmentIDAssignationPolicy in AttachmentMapper. That way we can 
override attachmentId assignation policy,

And finally make it easier to override Blob resolvers.

THis results in minimal code changes on James side and unlocks the possibility 
to experiment this in Twake mail side.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org

Reply via email to