omerfarukicen opened a new pull request, #2940:
URL: https://github.com/apache/james-project/pull/2940

   
   https://issues.apache.org/jira/browse/JAMES-4172
   
   In EmailBodyPartBlob, the size and content methods used different 
calculation paths for non-SingleBody parts (e.g. message/rfc822):
   - size relied on SizeUtils.sizeOf(entity) which returns the decoded size via 
SingleBody.size()
   - content used DefaultMessageWriter.writeBody() which re-encodes the content 
(e.g. base64), producing more bytes than the decoded size
   
   This mismatch caused Content-Length to be set smaller than the actual 
response body, resulting in truncated .eml downloads with missing attachments 
and MIME boundaries.
   
   Fix by caching the written body bytes in a lazy val so that both size and 
content use the same data, ensuring Content-Length matches the actual stream 
length.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to