Skip to content

NamedDataSource should implement EncodingAware #131

@ben-manes

Description

@ben-manes

When attaching a file, the content-type is inferred by MimeBodyPart by reading from the input stream. This occurs twice per attachment before the data is written out, resulting in 3 http calls. If the DataSource implements javax.mail.EncodingAware then this used if the result is non-null. When the file type is known, such as a pdf, this should avoid the extra hops. Unfortunately the given DataSource is decorated by NamedDataSource, so this optimization is not possible.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions