Uploaded image for project: 'Commons Email'
  1. Commons Email
  2. EMAIL-98

Encoding and folding of headers should not be left to the user

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.2
    • 1.3
    • None

    Description

      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))); }

      }

      Attachments

        Activity

          People

            sgoeschl Siegfried Goeschl
            mdaepp Mario Däpp
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: