Bugfix
Detail
#28667
Pipe closed Error when sending mail due to double rendering of content without EncodingAware interface
When sending emails, content (especially attachments) is always rendered twice.
Only if you generate a PDF and include it as an attachment to the mail does this lead to a "Pipe closed" error.
The problem is caused by two parallel stream accesses:
- PDF generator (producer thread): Generates PDF data and writes it to the pipe stream
- Mail system (consumer thread): Calls getEncoding(dataSource) to determine the correct encoding for the email attachment
Since the DataSource implementation for BinaryDataSource does not implement the EncodingAware interface, getEncoding() performs a separate stream access.