Skip to content

Improve encoding of attachment file names #232

@fadeyev

Description

@fadeyev

The org.simplejavamail.email.internal.EmailPopulatingBuilderImpl#withAttachment() methods contain call to MiscUtil.encodeText(text) which encode attachment names. If I want later to query attachments on my Email object, I'll see encoded messages, which are different from what was populated. It's not very convenient, I would expect this encoding to happen at a later stage, just before sending the email, keeping Java model clean and not overriding values I populated it with initially.

When parsing an msg file it also creates a problem, since resulting Email object won't have original file name at all - I have to decode it manually.

Morever, MimeUtility.encodeText() and MimeUtility.decodeText() do not work reliably on all platforms. I couldn't get to the bottom of it, but on my machine MimeUtility.encodeText(text) produces output which can't be parsed by MimeUtility.decodeText(text), although MimeUtility.encodeText(text, "UTF-8", "B") works well in all cases.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions