Skip to content

Enhancement: make Content-Transfer encoder detection more lenient, supporting more values from the wild #456

Closed
@bennettlevaton

Description

I'm trying to decode a mail object which uses Content-Transfer-Encoding: QUOTED-PRINTABLE and I am not able to get the EmailConverter.mimeMessageToEmailBuilder to convert the file due to the below exception

Caused by: java.lang.IllegalArgumentException: unknown content transfer encoder: QUOTED-PRINTABLE
	at org.simplejavamail.api.email.ContentTransferEncoding.lambda$byEncoder$1(ContentTransferEncoding.java:52)
	at java.base/java.util.Optional.orElseThrow(Unknown Source)
	at org.simplejavamail.api.email.ContentTransferEncoding.byEncoder(ContentTransferEncoding.java:52)
	at org.simplejavamail.converter.EmailConverter.buildEmailFromMimeMessage(EmailConverter.java:667)
	at org.simplejavamail.converter.EmailConverter.mimeMessageToEmailBuilder(EmailConverter.java:136)
	at org.simplejavamail.converter.EmailConverter.mimeMessageToEmailBuilder(EmailConverter.java:122)
	at org.simplejavamail.converter.EmailConverter.mimeMessageToEmailBuilder(EmailConverter.java:114)
	at com.forwarding.backend.helpers.EmailParsingHelper.getEmail(EmailParsingHelper.java:179)

I've tried using the builder to define the content encoding

EmailConverter.mimeMessageToEmailBuilder(message)
                .withContentTransferEncoding(ContentTransferEncoding.QUOTED_PRINTABLE)
                .buildEmail();

But this does not seem to override the above or ignore unknown content sources. Can this be added a feature if not available?

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions