djcb / mu

maildir indexer/searcher + emacs mail client + guile bindings
http://www.djcbsoftware.nl/code/mu
GNU General Public License v3.0
1.59k stars 384 forks source link

Encoding issue for some types of emails #2722

Open bderembl opened 5 days ago

bderembl commented 5 days ago

Steps to reproduce:

Enter Compose mode write an email to yourself with Subject: tést body: tést

send it so far so good. I receive the email, all is fine(*).

Now, jump in Sent Folder and select the email you just sent W (reply to all)

in this newly created reply, the subject appears as

Subject: Re: t\303\251st image

If I try to send the email, I get the warning

Non-Printable characters found. Continue sending?

I can still send it but I receive an email with a messed up subject

Here is the raw email in the "Sent folder"


From: BD <bruno@...>
To: BD <bruno@...>
Subject: tést
Date: Wed, 03 Jul 2024 09:12:18 +0200
Message-ID: <87tth7q78t.fsf@...>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: base64

dMOpc3QNCg==

(*)Sidenote: I can even reply to this first email that I just received and in that case, everything is fine. The problem is only for the email that is stored in the sent folder

Environment

mu4e 1.12.5 emacs 29.3

Checklist

djcb commented 4 days ago

Cannot reproduce. This is what I get:

From: "Dirk-Jan C. Binnema" <djcb@djcbsoftware.nl>
To: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
Subject: =?utf-8?Q?t=C3=A9st?=
Date: Wed, 03 Jul 2024 23:08:45 +0300
Message-ID: <87ed8az19u.fsf@djcbsoftware.nl>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: base64

dMOpc3QNCg==

Seems to be some encoding issue.

Did you try with emacs -Q and only the barest minimal setup for mu4e?

bderembl commented 4 days ago

From what I see from your email, your subject is correctly encoded: Subject: =?utf-8?Q?t=C3=A9st?= while mine is not Subject: tést

Do you have any idea why?

djcb commented 3 days ago

Yes, it's all correct here.

But, can you reproduce with a bare minimal mu4e? Use something like:

emacs -Q --eval "(progn (add-to-list 'load-path \"~/Sources/mu/build/mu4e\") (setq mu4e-mu-binary \"~/Sources/mu/build/mu/mu\") (require 'mu4e) (mu4e))"

(change the paths as necessary for your setup). Thanks.

bderembl commented 3 days ago

yes same problem. I need to proceed a bit differently in this case though because there is no context and mu4e is not configured to send an email.

with emacs -Q, I need to

-compose a mail with "tést" in subject, save it as a draft, select that draft, reply to all, same issue as described above.

bderembl commented 3 days ago

but I don't understand what you mean by " it's all correct here." since our subjects differ.

djcb commented 2 days ago

"It's all correct here" means "When I try this, the subject is correctly encoded"

We need to find out why it's not at your side. I suspect this goes a bit beyond mu4e... can you try some of the suggestions here? https://emacs.stackexchange.com/questions/7946/using-utf8-encoding-as-default-when-writing-emails

bderembl commented 4 hours ago

Thank you for your assistance. I have just tried all solutions proposed in your link but I get the same issue.

Could you clarify the sequence of events that happens when I save a mail as a draft?

In my case, the body of the message is correctly encoded but not the subject. Are these two elements treated separately?