Subject: bug#56422: 29.0.50; mail-extract-address-components poorly handles " via " addresses

From: Lars Ingebrigtsen <[email-masked]>
Date: Thu, 07 Jul 2022 11:10:28 +0200

Sam Steingold <[email-masked]> writes:

> The correct handling would be
>
> (mail-extract-address-components "Po Lu via \"Emacs development discussions.\" <[email-masked]>")
> => ("Emacs development discussions." "[email-masked]")

mail-extract-address-components is a DWIM-ish thing that doesn't have
much documented behaviour -- it just tries to make things "pretty" by
applying lots of (mostly misguided) heuristics.  So talking about
"correct" here isn't er correct.

If you have an RFC822bis From header, you should use
`mail-header-parse-address'.  If you have something that's vaguely like
a mail header and want to split it, use `mail-header-parse-address-lax'.

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