Bug 433995 - Attachments with accentuated characters in their file names are automatically renamed "attachment.bin"
Summary: Attachments with accentuated characters in their file names are automatically...
Status: REPORTED
Alias: None
Product: kmail2
Classification: Applications
Component: general (show other bugs)
Version: 5.16.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-05 09:42 UTC by Cyb3rD4d
Modified: 2022-11-21 11:31 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cyb3rD4d 2021-03-05 09:42:43 UTC
SUMMARY
First of all, I could not select my Kmail version as it was not is the list. My version is 5.16.3.
My files often contain accentuated characters in their names (I am french and this is a very common situation for us). When I attach such files in an email, the recipients always receive renamed files "attachment.bin".
I reproduce the issue with PDF, images and plain text files (I did not test with other file types but it does not seem to be related to the mime types), and with or without white spaces in the file names.

STEPS TO REPRODUCE
1. Open the "New message" window.
2. Add one or several attachments with accentuated characters in their file names (i.e. "test é.txt" or "voyage-à-paris.png").
3. Send the email to yourself.

OBSERVED RESULT
Wait to receive the email, you should see that your files have been renamed "attachment.bin".

EXPECTED RESULT
The attached files should keep their original file names with their extensions.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Archlinux
(available in About System)
KDE Plasma Version: 5.21.2
KDE Frameworks Version: 5.79.0
Qt Version: 5.12.2

ADDITIONAL INFORMATION
Comment 1 Laurent Montel 2021-03-05 09:55:35 UTC
Hello,
I am french too.
And it works fine here.
For sure we don't rename it.
Could you test several smtp server to be sure ?

Regards.
Comment 2 Laurent Montel 2021-03-05 09:57:35 UTC
You can use "view source" (shortcut "V") in your send folder for seeing which name it uses.
Comment 3 Cyb3rD4d 2021-03-05 13:40:20 UTC
Hello Laurent

I use the Protonmail bridge, but it does not seem to be an SMTP issue because I don't reproduce with Thunderbird. I have an old Gmail account somewhere, I can try with it.

Here is the source of the sent email (without the file's content):

From: Martial Saunois <martial@saunois.net>
To: xxxxx
Subject: pdf3
Date: Fri, 05 Mar 2021 09:54:16 +0100
Message-ID: <1815530.R5LG11lME9@soad>
X-KMail-Identity: xxxxx
X-KMail-Transport: xxxxx
X-KMail-Fcc: 20
X-KMail-Identity-Name: xxxxx
X-KMail-Transport-Name: Protonmail
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="nextPart8847928.zgmNX5ZPIN"
Content-Transfer-Encoding: 7Bit

This is a multi-part message in MIME format.

--nextPart8847928.zgmNX5ZPIN
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"


--nextPart8847928.zgmNX5ZPIN
Content-Disposition: attachment; filename*=ISO-8859-1''Certificat%20m%E9dical%2Epdf
Content-Transfer-Encoding: base64
Content-Type: application/pdf; name*=iso-8859-1''Certificat%20m%E9dical%2Epdf

And here is the source of the received email:

Content-Type: multipart/mixed; boundary=81facc3804535dd466211b0b92a1051892fb88e331a5678ccb006af1c8ed2fad
Date: Fri, 05 Mar 2021 08:54:17 +0000
Delivered-To: xxxxxxx
From: "Martial Saunois" <martial@saunois.net>
Message-Id: <1815530.R5LG11lME9@soad>
Mime-Version: 1.0
Received: from mail.protonmail.ch by mail.protonmail.ch; Fri, 05 Mar 2021 08:54:22 +0000
References: <avFRvPJH5FfVeYxzcjtBBouIKF1codwhO9v3qmOsL90yIu6ICMDprh9Lx25YeW0UTTxVuYVG38zXUQo4-qvv2g==@protonmail.internalid>
Reply-To: "Martial Saunois" <martial@saunois.net>
Return-Path: <martial@saunois.net>
Subject: pdf3
To: xxxxxx
X-Attached: attachment.bin
X-Original-To: xxxxxx
X-Pm-Content-Encryption: end-to-end
X-Pm-Conversationid-Id: yDHE9UNFm9KVQ5qWc1PW-fSgq4W2rvLm1-RgciODL-i_fxQASQ4_9k0obst4sSqPU46B-Iuafg2_vEW4ZFdQ8A==
X-Pm-Date: Fri, 05 Mar 2021 09:54:17 +0100
X-Pm-External-Id: xxxxxx
X-Pm-Internal-Id: xxxxxx
X-Pm-Origin: internal
X-Pm-Spamscore: 0

 

--81facc3804535dd466211b0b92a1051892fb88e331a5678ccb006af1c8ed2fad
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=utf-8


--81facc3804535dd466211b0b92a1051892fb88e331a5678ccb006af1c8ed2fad
Content-Disposition: attachment; filename=attachment.bin
Content-Transfer-Encoding: base64
Content-Type: application/pdf; name=attachment.bin
Comment 4 Cyb3rD4d 2021-03-05 14:06:49 UTC
I tried with the Gmail SMTP and the files are not renamed, so I am quite confused...
I will check again if I find some differences in my settings between Thunderbird and Kmail.
Comment 5 Laurent Montel 2021-03-05 14:08:06 UTC
Content-Disposition: attachment; filename*=ISO-8859-1''Certificat%20m%E9dical%2Epdf
Content-Transfer-Encoding: base64
Content-Type: application/pdf; name*=iso-8859-1''Certificat%20m%E9dical%2Epdf

=> it's correctly encoded.
you received an email which is modified. 

It seems that protonmail change it.
It seems that it encrypts it. So perhaps it renamed it.
but it's kmail which renamed it (no "attachment.bin" string in source code)
Comment 6 Cyb3rD4d 2021-03-18 13:17:41 UTC
FYI I asked the question to the Protonmail technical team, I keep you posted as soon as I receive an answer.
Comment 7 Freedim 2022-11-21 11:09:38 UTC
Same problem here with version 2.3.0 of Bridge and KMail embedded in Kontact 5.21.3
Comment 8 Freedim 2022-11-21 11:31:56 UTC
(In reply to Freedim from comment #7)
> Same problem here with version 2.3.0 of Bridge and KMail embedded in Kontact
> 5.21.3

I have tried with another SMTP (Free Telecom) and the result is that every "é" is replaced by "%C3%A9" in the attachment name, which looks like the UTF-8 code of "é" (0xC3 0xA9). Is it possible that such a name including "%C3%A9" not be recognised by Bridge (maybe because "%" would be forbidden), which in turn would rename it to "attachment.bin" by default instead?

In that case, would it be possible to set KMail to use UTF-8 instead of ISO-8859-1 for attachment names?