Subject: Re: bug#19431: 24.4; Bad handling of RFC2047 encoded headers by 'mail-extract-address-components'

From: Lars Ingebrigtsen <[email-masked]>
Date: Sun, 15 Apr 2018 19:51:13 +0200

Enrico Scholz <[email-masked]> writes:

> the emacs email framework fails on email addresses containing umlauts.
> E.g. in the following example
>
> --- {{{ snip ---
> ; set a (nearly) real-world To: address; the umlaut '=C3=A4' encoding
> ; was replaced by '=61=65'
> (let* ((address "=?utf-8?Q?B=61=65Br=2C_Klaus?= <[email-masked]>")
>        (decoded (rfc2047-decode-string address)))
>   ; show output with encoded umlauts and non-RFC2047 header
>   (print (mail-extract-address-components "\"Baer, Klaus\" <[email-masked]>"))
>   (print address t)
>   (print decoded t)
>   ; previous prints were just for debugging purposes; now, the real
>   ; functions will be called...
>   (print (mail-extract-address-components address))
>   (print (mail-extract-address-components decoded)))

Yes, that's a very confusing and not very useful function.  I've now
updated the doc string to point to `mail-header-parse-address', which is
the function that should be used to parse address headers, and does the
right thing also on German addresses.

I don't think it's worth trying to fix the mess that is
`mail-extract-address-components'.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no