Conversation
…nt file names JakartaMailFlowableMailClient.createMultiPartContent() was manually RFC-2047-encoding attachment file names with MimeUtility.encodeText() before handing them to MimeBodyPart.setFileName(). When the resulting encoded-word string was also too long for one header line, Jakarta Mail's own RFC 2231 parameter continuation splitting kicked in on top of it, splitting mid-encoded-word and corrupting the header. Pass the raw file name to setFileName() instead and let Jakarta Mail's own RFC 2231 encoding/folding handle it in a single consistent pass. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…e JVM default The previous fix removed the manual RFC-2047 pre-encoding that corrupted the Content-Disposition header, but MimeBodyPart.setFileName() ignores the charset argument passed to createMultiPartContent() entirely: its default code path RFC 2231-encodes with MimeUtility.getDefaultMIMECharset(), which resolves to the mail.mime.charset system property or, failing that, the JVM's file.encoding — neither of which is the charset Flowable computed for the rest of the message (subject, headers, text/html body). Build the Content-Disposition header directly via ParameterList/ ContentDisposition instead, passing the charset through explicitly so the attachment file name is encoded consistently with the rest of the message regardless of JVM/system defaults. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ttachment file names - Add two real integration tests to EmailServiceTaskTest (mail service task, real SMTP mock server, real MimeMessage on the wire) covering the long non-ASCII attachment file name corruption and the charset-fidelity fix, following the module's convention of testing through the engine rather than by calling internal methods directly. - When no charset is configured for the message, setAttachmentFileName() was falling back to a hardcoded UTF-8, while the text/html body parts (MimeBodyPart.setText() with a null charset) fall back to MimeUtility.getDefaultMIMECharset(). On a JVM whose default charset isn't UTF-8, this could reintroduce a charset mismatch between the attachment file name and the rest of the message. Use the same default the body already falls back to instead. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Check List: