Sebb created EMAIL-171:
--------------------------

             Summary: buildMimeMessage() unconditionally encodes and folders 
header values
                 Key: EMAIL-171
                 URL: https://issues.apache.org/jira/browse/EMAIL-171
             Project: Commons Email
          Issue Type: Bug
            Reporter: Sebb


The buildMimeMessage() method unconditionally calls MimeUtility#fold and 
MimeUtility#encodeText for all entries in the headers Map.

However the encodeText method is only suitable for "unstructured" RFC 822 
headers, i.e. those which consist of arbitrary text.

If the headers Map contains any keys that have structured values, and the value 
contains any non-ASCII characters, then generated header may be corrupted.

If the user adds a structured header to the Map, they need to ensure that the 
value is already ASCII-encoded using the appropriate strategy for the field.

This needs to be documented.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to