Commons Email
  1. Commons Email
  2. EMAIL-104

The system property "mail.mime.charset" is not applied to contents.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.2
    • Fix Version/s: 1.3.2
    • Labels:

      Description

      Both of JavaMail and Commons Email encode subjects and personal names with the system property "mail.mime.charset" when no charsets are specified via methods. Also they encode attached filenames with the property when the other system property "mail.mime.encodefilename" is set (regardless of RFC). On the other hand, JavaMail encodes text contents with the property via setText methods when no charsets specified, but Commons Email doesn't encode the contents via setMsg/setTextMsg/setHtmlMsg methods. The partial difference of the behaviors makes confusion.

        Activity

        Hiroshi Ikeda created issue -
        Siegfried Goeschl made changes -
        Field Original Value New Value
        Assignee Siegfried Goeschl [ sgoeschl ]
        Hide
        Siegfried Goeschl added a comment -

        I'm not sure if I understand the problem correctly

        +) setTextMsg() and setHtmlMsg() take the plain string
        +) that plain strings are afterwards encoded when the MimeMessage is built (HTMLEmail.build())

        Can you please clarify?

        Show
        Siegfried Goeschl added a comment - I'm not sure if I understand the problem correctly +) setTextMsg() and setHtmlMsg() take the plain string +) that plain strings are afterwards encoded when the MimeMessage is built (HTMLEmail.build()) Can you please clarify?
        Hide
        Siegfried Goeschl added a comment -

        Well - I need to read up on the Mail API ...

        Show
        Siegfried Goeschl added a comment - Well - I need to read up on the Mail API ...
        Hide
        Hiroshi Ikeda added a comment -

        I forget many things about several months ago, and I find my memo which says:
        If you call MimeMessage/MimeBody.setContent directly, instead of setText, then the system property "mail.mime.charset" is not used. HtmlEmail and SimpleEmail in Commons Email call the setContent methods.

        Show
        Hiroshi Ikeda added a comment - I forget many things about several months ago, and I find my memo which says: If you call MimeMessage/MimeBody.setContent directly, instead of setText, then the system property "mail.mime.charset" is not used. HtmlEmail and SimpleEmail in Commons Email call the setContent methods.
        Hide
        Thomas Neidhart added a comment -

        Could you please attach a minimal test case illustrating the problem?

        Thanks,

        Thomas

        Show
        Thomas Neidhart added a comment - Could you please attach a minimal test case illustrating the problem? Thanks, Thomas
        Hide
        Thomas Neidhart added a comment -

        Fixed in r1532531 by using the appropriate setText() methods in case of text content.

        The corresponding unit tests can be further improved but there seems to be a bug in junit when using non-standard charsets.

        Show
        Thomas Neidhart added a comment - Fixed in r1532531 by using the appropriate setText() methods in case of text content. The corresponding unit tests can be further improved but there seems to be a bug in junit when using non-standard charsets.
        Thomas Neidhart made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 1.3.2 [ 12324666 ]
        Resolution Fixed [ 1 ]
        Thomas Neidhart made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Siegfried Goeschl
            Reporter:
            Hiroshi Ikeda
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development