[ 
https://issues.apache.org/jira/browse/EMAIL-171?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sebb updated EMAIL-171:
-----------------------
    Description: 
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, the 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.

  was:
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.


> buildMimeMessage() unconditionally encodes and folds 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, the 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