Subject: bug#77866: 30.0.50; message.el handling of non-ascii names in addresses

From: Eli Zaretskii <[email-masked]>
Date: Thu, 17 Apr 2025 16:19:21 +0300

> From: Al Haji-Ali <[email-masked]>
> Date: Thu, 17 Apr 2025 13:54:21 +0100
> 
> 
> This is a bit difficult for me to reproduce as a user in a clean instance of Emacs, since I am seeing it in notmuch, which uses message.el, and I don't know how to use message.el without my setup of notmuch.
> However, I am sure that I've identified the reason for the bug(?) in message.el and I hope my description below is sufficient.
> 
> I have an email with a header field like this:
> CC: "Blanco, Raúl" <[email-masked]>
> 
> with a non-ASCII character in the name. When I call `message-send-mail`, on 29.1 I get an error
> `split-string: Wrong type argument: stringp, nil`
> 
> and on 30.0.50, I get the error
> `Email address can't be parsed`
> 
> The reason is that `message-send-mail` calls `mail-encode-encoded-word-buffer`, which encodes that part of the message as:
> 
> CC: "Blanco, =?utf-8?Q?Ra=C3=BAl=22?= <[email-masked]>
> 
> So that the quotation marks are no longer paired, and `mail-header-parse-addresses` splits the address into two ill-formed ones.

Isn't that because of the comma?  If you change the address to

  "Blanco Raúl" <[email-masked]>

does the problem go away?