No announcement yet.
  • Filter
  • Time
Clear All
new posts

    Problem with mail headers ("from", "to") and umlauts (OK in "subject")

    Hi Isomorphic,

    I have a question regarding mail headers (from, subject) and umlauts.

    To me it seems there is some difference in how you set those.
    This is my mail configuration in .ds.xml:

            <operationBinding operationType="fetch" operationId="writeMailLeadMovedToPicklist" serverMethod="writeMailLeadMovedToPicklist">
                <mail contentType="text/html">
                    <subject>$t_translation.getTranslation($CASEWORKER_LANG_ISO_639_1_AL_2, "mail_leadMovedToPicklistTemplateReseller", "subject")</subject>
    It results in such an email header (some fields redacted):
    Return-Path: <>
    Received: from
        by with LMTP
        (envelope-from <>)
        for <>; Thu, 16 May 2019 10:45:20 +0200
    Return-path: <>
    Delivery-date: Thu, 16 May 2019 10:45:20 +0200
    Received: from ([]:44330 helo=mytomcat)
        by with esmtpsa (TLSv1:ECDHE-RSA-AES256-SHA:256)
        (Exim 4.91)
        (envelope-from <>)
        id 1hRC0u-001Wm0-8o; Thu, 16 May 2019 10:45:20 +0200
    Date: Thu, 16 May 2019 10:45:21 +0200 (CEST)
    From: "original text with just umlauts removed" <>
    To: Givenname Surname <>
    Message-ID: <478510790.490.1557996321528.JavaMail.tomcat@mytomcat>
    Subject: =?Cp1252?Q?Ein_neues_Lead_ist_f=FCr_Sie_verf=FCgbar?=
    MIME-Version: 1.0
    Content-Type: text/html; charset=UTF-8
    Content-Transfer-Encoding: quoted-printable
    As you can see, some encoding information is set to the Subject. This does not happen to From and To.

    Subjects are then displayed just fine in email programs, in to and from all umlauts are just removed - not there.
    For to I do some replacement before. A user "Max Müller" <> does not care if his name is written as "Max Mueller" <> in general.
    This is not true for from where there is normally a company name contained that should preserve the umlauts in a name.
    I know that there is a javax setSubject() overload that is taking an encoding parameter and that there is no such thing for e.g. setFrom(), setsetRecipients(), but there must be some way to send umlauts here, I just can't find out how. Perhaps you can help as you either know this or can deduce it from the methods you are using when creating a mail.

    In my .ds.xml, the velocity variables hold content fetched from the DB as normal type="text" field.
    The text "original text with just umlauts removed" <> from above in reality is "original text with just umlautsäöü removed" <>

    Best regards

    Hi Isomorphic,

    we are using version 1.4.2 of mail.jar you are shipping, which seems to be from February 2009. Current version is 1.6.2 from August 2018.
    It does contain changes for umlauts in mail-addresses, which most likely is not a common thing in the US, very seldom just in Germany, but might be used a lot in non-western countries.
    It does require JDK 1.7, which is not a problem for me, but perhaps for you. But I'd assume that it is safe nowadays to require Java 8 for projects in active development.

    This does not directly relate to the umlaut-in-from/to, but also to umlauts in general.

    Best regards


      It sounds like you are suggesting that the problem may be corrected by a newer version of mail.jar. You didn't say whether this new mail.jar version is backwards compatible or whether you've tried it - please let us know.


        Hi Isomorphic,

        will do, but the general question was "How do you set From/To for a mail in your servercode for a <mail>-tag" and if you know this problem from your own projects.

        Best regards


          Hi Isomorphic,

          just replacing your mail.jar with javax.mail.jar v1.6.2 from fixes the problem for me:
          Click image for larger version

Name:	Mail-Umlauts.png
Views:	18
Size:	5.8 KB
ID:	257806

          Best regards


            Hi Isomorphic,

            the "missing" Umlauts is probably some rendering problem. In other views in different mail programs the umlauts are displayed as broken:

            Roundcube bad:
            Click image for larger version

Name:	Mail-Umlauts2.png
Views:	19
Size:	2.6 KB
ID:	257808

            Office365 bad:
            Click image for larger version

Name:	Mail-Umlauts3.png
Views:	15
Size:	8.0 KB
ID:	257809

            With the new version, both look good:

            Roundcube good:
            Click image for larger version

Name:	Mail-Umlauts4.png
Views:	14
Size:	2.4 KB
ID:	257811

            Office365 good:
            Click image for larger version

Name:	Mail-Umlauts5.png
Views:	14
Size:	3.1 KB
ID:	257810

            Best regards


              We actually do already ship 12.1 (still in development as of this post) with version 1.6.2. For those on past releases, if you're having this issue, please replace activation.jar and mail.jar with the suggested jar to resolve this problem if you're encountering it.


                Hi Isomorphic,

                just to let you know, there is now a version 1.6.4 available on the EE4J page as well.

                Best regards