This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch email-full-view-cid
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 65bea6b338f068a705e34951610df44eb25aa0ec
Author: Benoit TELLIER <btell...@linagora.com>
AuthorDate: Mon May 5 17:20:42 2025 +0200

    [FIX] Email/get full view: hasAttachment should filter out inlined 
attachment with cid
---
 .../src/main/scala/org/apache/james/jmap/mail/Email.scala              | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/mail/Email.scala
 
b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/mail/Email.scala
index b60b4ae0eb..5fec7826f6 100644
--- 
a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/mail/Email.scala
+++ 
b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/mail/Email.scala
@@ -38,6 +38,7 @@ import 
org.apache.james.jmap.api.projections.{MessageFastViewPrecomputedProperti
 import org.apache.james.jmap.core.Id.{Id, IdConstraint}
 import org.apache.james.jmap.core.{Properties, UTCDate}
 import org.apache.james.jmap.mail.BracketHeader.sanitize
+import org.apache.james.jmap.mail.Disposition.ATTACHMENT
 import org.apache.james.jmap.mail.EmailFullViewFactory.extractBodyValues
 import org.apache.james.jmap.mail.EmailGetRequest.MaxBodyValueBytes
 import org.apache.james.jmap.mail.EmailHeaderName.{ADDRESSES_NAMES, DATE, 
MESSAGE_ID_NAMES}
@@ -625,7 +626,7 @@ private class EmailFullViewFactory 
@Inject()(zoneIdProvider: ZoneIdProvider, pre
           size = sanitizeSize(firstMessage.getSize)),
         header = EmailHeaders.from(zoneIdProvider.get())(mime4JMessage),
         bodyMetadata = EmailBodyMetadata(
-          hasAttachment = 
HasAttachment(!firstMessage.getLoadedAttachments.isEmpty),
+          hasAttachment = 
HasAttachment(!bodyStructure.attachments.exists(attachment -> 
attachment.disposition.contains(ATTACHMENT) || attachment.cid.isEmpty)),
           preview = preview),
         body = EmailBody(
           bodyStructure = bodyStructure,


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

Reply via email to