nextcloud / mail

💌 Mail app for Nextcloud
https://apps.nextcloud.com/apps/mail
GNU Affero General Public License v3.0
832 stars 258 forks source link

Wrong character encoding when sending e-mail #10120

Open moraus opened 1 week ago

moraus commented 1 week ago

Steps to reproduce

  1. Compose a new e-mail
  2. Write for example Scandinavian characters like æ, ø or ö
  3. Inspect the e-mail

Expected behavior

This is the test e-mail message sent:

Hello! This is a test with Norwegian characters: æ=ae, ø=oe, å=aa Below is a empty line:

Below is the pre-configured signature --

### Actual behavior Below is the result / received e-mail: Hello! This is a test with Norwegian characters: =C3=A6=3Dae, =C3=B8=3Doe, =C3=A5= =3Daa Below is a empty line: =C2=A0 Below is the pre-configured signature --=C2=A0=C2=A0 =C2=A0 ### Mail app version 3.7.8 ### Mailserver or service Exim4 on localhost ### Operating system Linux ### PHP engine version PHP 8.1 ### Web server Apache (supported) ### Database MySQL ### Additional info _No response_
ChristophWurst commented 1 week ago

Hello! This is a test with Norwegian characters: =C3=A6=3Dae, =C3=B8=3Doe, =C3=A5= =3Daa Below is a empty line: =C2=A0 Below is the pre-configured signature --=C2=A0=C2=A0

=C2=A0

Please export the email as .eml, rename .txt and upload it here.

moraus commented 1 week ago

Thanks for the swift reply. See the attached file. Testing character encoding.txt

ChristophWurst commented 1 week ago

Confirmed. The transfer encoded string also shows in Gnome Evolution.

kesselb commented 1 week ago

I'm seeing the content header twice in the exported message.

Content-Type: text/plain; charset=utf-8 Content-Type: text/plain

I assume the second overwrites the first, removes the utf-8 charset and forces the client to render the message as ascii or iso-8859-1.

Is maybe another service in the chain (exim4 -> gmail -> exchange) changing the message? Do you see the same problem if you send the message for gmail or a different mail server?

moraus commented 6 days ago

I don't think it's the e-mail server chain. I did a test with the same sever chain, while using mutt as the "composing" client. The chain was: Mutt -> Exim4 -> Gmail-Smarthost -> Outlook Mutt adds Content-Type: text/plain; charset=iso-8859-1 and Outlook rendres the e-mail correctly.

See attached file: Test_ Mutt->Exim->Gmail->Outlook.txt