dodo icon indicating copy to clipboard operation
dodo copied to clipboard

Replying does not decode UTF-8 addresses

Open The-Compiler opened this issue 1 year ago • 2 comments

When I reply to a mail that gets shown as From: Firstname Sjökvist in the UI, the draft and reply show To: =?utf-8?q?Firstname_Sj=C3=B6kvist?= <[email protected]>.

I haven't tried how that actually arrives when sending (i.e. whether that gets escaped again to a literal =?utf8?...), but IMHO:

  • The draft and editor should show this as To: Firstname Sjökvist
  • Only when sending, that should be encoded accordingly

The-Compiler avatar Oct 14 '24 10:10 The-Compiler

This seems to be a regression caused by 75317070346c3c268de4b5163a1ea0c95ef82a81, and more specific usage of the function email.utils.formataddr, which 'header-encodes' the name:

>>> email.utils.formataddr(('Céline', '[email protected]'))
'=?utf-8?q?C=C3=A9line?= <[email protected]>'

Source: emails.util.formataddr

hbog avatar Nov 19 '24 20:11 hbog

One solution could be not to touch the address headers (they are already properly formatted by notmuch) and use notmuch-reply to construct the reply template. It also adds "In-Reply-To" and "References" headers. In other words let notmuch do the heavy lifting.

hbog avatar Nov 19 '24 21:11 hbog