Why doesn JavaMail properly encode and decode filenames in non-ASCII character sets?
The filename is stored as a parameter in MIME headers. Encoded filenames of the form =?ISO-8859-15?B?5OTkLUluZm8ucGRm?= are not part of the MIME spec. A filename of the form =?A?B?C?= is a perfectly valid filename, not an incorrectly encoded filename. JavaMail does not encoded and decode filenames by default because doing so would violate the MIME spec.