commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mario Däpp (JIRA) <j...@apache.org>
Subject [jira] Created: (EMAIL-98) Encoding and folding of headers should not be left to the user
Date Tue, 27 Jul 2010 08:11:16 GMT
Encoding and folding of headers should not be left to the user
--------------------------------------------------------------

                 Key: EMAIL-98
                 URL: https://issues.apache.org/jira/browse/EMAIL-98
             Project: Commons Email
          Issue Type: Improvement
    Affects Versions: 1.2
            Reporter: Mario Däpp
            Priority: Minor


Currently, folding and encoding of e-mail headers is completely left to the user. As commons-email
is aimed at simplification of the Java Mail API, the encoding and folding issues should be
taken care of by commons-email.

The method buildMimeMessage() in Email.java should be changed as follows:

if (this.headers.size() > 0)
{
    Iterator iterHeaderKeys = this.headers.keySet().iterator();
    while (iterHeaderKeys.hasNext())
    {
        String name = (String) iterHeaderKeys.next();
        String value = (String) headers.get(name);
        this.message.addHeader(name, MimeUtility.fold(name.length() + 2, MimeUtility.encodeText(value,
this.charset, null)));
    }
}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message