You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Vít Rozkovec (JIRA)" <ji...@apache.org> on 2018/03/22 18:39:00 UTC

[jira] [Commented] (EMAIL-138) Czech/Slovak diacritic marks in the file name of the attached file screw whole sent email

    [ https://issues.apache.org/jira/browse/EMAIL-138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16410086#comment-16410086 ] 

Vít Rozkovec commented on EMAIL-138:
------------------------------------

I am also in favor of reverting as JavaMail can encode the filename, if need be.

This change broke some of my e-mail attachments which cannot be displayed in gmail now, Thunderbird is ok, though.

Here is relevant source part of the message that shows how is the name and filename encoded that gmail has troubles with:

{{------=_Part_4_279180659.1521739053595}}
{{Content-Type: application/octet-stream; name="=?UTF-8?Q?Nabidka=5F120001=5F2012-04-14=5F201?= =?UTF-8?Q?2-\"; name*1=\"05-03=5FTestovac=C3=AD_nab=C3=ADdka.pdf?="}}
{{Content-Transfer-Encoding: base64}}
{{Content-Disposition: attachment; filename="=?UTF-8?Q?Nabidka=5F120001=5F2012-04-14=5F201?= =?UTF-8?Q?2-\"; filename*1=\"05-03=5FTestovac=C3=AD_nab=C3=ADdka.pdf?="}}
{{Content-Description: "Some description"}}

 

And here how it shows in gmail. The file sent is valid pdf file.

{{!Gmail attachments.png!}}

 

Proper filename should be: Nabidka_120001_2012-04-14_2012-05-03_Testovací nabídka.pdf

I had to hack around this behavior by attaching file first by

{{    public MultiPartEmail attach(}}
{{        final DataSource ds,}}
{{        final String name,}}
{{        final String description)}}
{{        throws EmailException}}
{{    }}

then via reflection get the "container" property of the ImageHtmlEmail and get body part that was added as the last one and setting the filename directly, without using MimeUtility.encodeText(name).

Attachments display correctly now.

> Czech/Slovak diacritic marks in the file name of the attached file screw whole sent email
> -----------------------------------------------------------------------------------------
>
>                 Key: EMAIL-138
>                 URL: https://issues.apache.org/jira/browse/EMAIL-138
>             Project: Commons Email
>          Issue Type: Bug
>    Affects Versions: 1.3.2
>         Environment: Windows 7, JDK 7 (6 compatible).
>            Reporter: qed
>            Priority: Minor
>              Labels: diacritic
>             Fix For: 1.3.3
>
>         Attachments: Gmail attachments.png
>
>
> Czech/Slovak diacritic marks in the file name of the attached file screw whole sent email. Email will arrive but it's content will be messy. An example of a filename which does this is "nazevřšččššě.txt". Optionally put some text in email and in file. I tried HtmlEmail.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)