unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* issue with mail-extract-address-components
@ 2017-03-15 20:11 Eric Abrahamsen
  2017-03-15 20:42 ` Andreas Schwab
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Abrahamsen @ 2017-03-15 20:11 UTC (permalink / raw)
  To: emacs-devel

I got an email with a malformed CC line:

Lörsch, Karl <loersch@domain.cc>, "Wegner, Simon" <Wegner@domain.cc>

Ie, no quotes around the first name. `mail-extract-address-components'
splits on the comma, as I suppose it should, and its return value is:

(("Lörsch" "Lörsch")
 ("Karl" "loersch@domain.cc")
 ("Simon Wegner" "Wegner@domain.cc"))

It's doing the best it can here, but I would expect ("Lörsch" nil) as
the first element, which would make it easier for other functions to
handle the return value correctly.

Comments in mail-extr.el allude to a corpus of test cases too vast to be
included in the codebase, and direct us to the Maintainer if we find
cases that need to be handled. But those comments are from 1994, and the
Maintainer is this mailing list, so...

Does anyone have an opinion about this? I suppose handling the CC line
"correctly" would be the wrong thing to do, but I sure would prefer
("Lörsch" nil).

Thanks,
Eric




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: issue with mail-extract-address-components
  2017-03-15 20:11 issue with mail-extract-address-components Eric Abrahamsen
@ 2017-03-15 20:42 ` Andreas Schwab
  2017-03-15 21:08   ` Eric Abrahamsen
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Schwab @ 2017-03-15 20:42 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: emacs-devel

On Mär 15 2017, Eric Abrahamsen <eric@ericabrahamsen.net> wrote:

> I got an email with a malformed CC line:
>
> Lörsch, Karl <loersch@domain.cc>, "Wegner, Simon" <Wegner@domain.cc>
>
> Ie, no quotes around the first name. `mail-extract-address-components'
> splits on the comma, as I suppose it should, and its return value is:
>
> (("Lörsch" "Lörsch")
>  ("Karl" "loersch@domain.cc")
>  ("Simon Wegner" "Wegner@domain.cc"))
>
> It's doing the best it can here, but I would expect ("Lörsch" nil) as
> the first element, which would make it easier for other functions to
> handle the return value correctly.

Does mail-extract-address-components actually care whether the singleton
is a valid address?  Should it handle foo@bar different from foo?  But
foo could actually be a valid address in the local domain.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: issue with mail-extract-address-components
  2017-03-15 20:42 ` Andreas Schwab
@ 2017-03-15 21:08   ` Eric Abrahamsen
  0 siblings, 0 replies; 3+ messages in thread
From: Eric Abrahamsen @ 2017-03-15 21:08 UTC (permalink / raw)
  To: emacs-devel

Andreas Schwab <schwab@linux-m68k.org> writes:

> On Mär 15 2017, Eric Abrahamsen <eric@ericabrahamsen.net> wrote:
>
>> I got an email with a malformed CC line:
>>
>> Lörsch, Karl <loersch@domain.cc>, "Wegner, Simon" <Wegner@domain.cc>
>>
>> Ie, no quotes around the first name. `mail-extract-address-components'
>> splits on the comma, as I suppose it should, and its return value is:
>>
>> (("Lörsch" "Lörsch")
>>  ("Karl" "loersch@domain.cc")
>>  ("Simon Wegner" "Wegner@domain.cc"))
>>
>> It's doing the best it can here, but I would expect ("Lörsch" nil) as
>> the first element, which would make it easier for other functions to
>> handle the return value correctly.
>
> Does mail-extract-address-components actually care whether the singleton
> is a valid address?  Should it handle foo@bar different from foo?  But
> foo could actually be a valid address in the local domain.

I don't know if it should care or not, that's really what I'm asking
here.

Later on in the conversion Karl sent an email directly, and his name in
the From: header was again with a comma but no quotes. When I replied to
him my Message buffer looked like this:

To: Lörsch
Cc: karl <loersch@domain.cc>

"Lörsch" might be a valid address in the local domain, but personally
I'd prefer if it got it wrong the other way.

E




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-03-15 21:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-15 20:11 issue with mail-extract-address-components Eric Abrahamsen
2017-03-15 20:42 ` Andreas Schwab
2017-03-15 21:08   ` Eric Abrahamsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).