Open masooh opened 4 years ago
I can see that this doesn't look particularly attractive, but it also seems to function correctly. Have you seen mailers that don't handle this properly?
yes, it's Outlook 365 ;) We use Redemption to Import a MIME file like the one above into Outlook. Using Outlook converter (olRFC822_Outlook as argument for Import()) results in an attachment named "unknown attachment".
So doesn't it seem like the bug is in Outlook converter, since it's the one that's not interpreting this valid MIME content properly?
In the example the fields Name and filename both have a newline in it's value. I don't think that's ok. To me it seems you are actively changing the value of a field by putting a newline in.
There are existing folding and unfolding rules that allow newline to be inserted and removed transparently.
I'm sure there are. But I struggle to find the corresponding rules. Can you provide a link? Have you successfully tried this folded fields with other mailers?
RFC 2822 talks about folding white space in headers.
The headers in your example message above work fine in Thunderbird using the UW IMAP server.
I spent far too much time working on this and I think I've got a fix for it. Unfortunately, the changes are just too large to consider for this release. I'm going to hold them off for a future release, probably a 2.0.1 release. In the mean time, I've pushed the changes into branch ParameterList-fix-418.
Describe the bug When using a long filename in a multipart message this filename should be separated with Continuations, see https://tools.ietf.org/html/rfc2231: 3. Parameter Value Continuations. This is used, but also folding (see https://tools.ietf.org/html/rfc5322#section-3.2.2) is used on top of it. As the goal of the "Parameter Value Continuations" is to avoid white space problems, folding should not be used here.
To Reproduce
Result is:
Expected behavior Result should be
Desktop (please complete the following information):
Additional context Used Version Jakarta Mail 1.6.4