core: Improve mailbox only uid handling
authorAndre Heinecke <aheinecke@intevation.de>
Wed, 1 Feb 2017 15:16:22 +0000 (16:16 +0100)
committerAndre Heinecke <aheinecke@intevation.de>
Wed, 1 Feb 2017 15:17:07 +0000 (16:17 +0100)
commita28d31fdb623f2ee30e8094d09f1a0d1ae446a9b
tree3fd263ce57b641e3ffa107c3aa7f6c94ca6a8922
parentba594d85e35e63301755977234d3af88a167a215
core: Improve mailbox only uid handling

* src/key.c (_gpgme_key_append_name): Set email and remove name
for uid only keys.

--
If we have a name and no email but the name can be parsed as
an address we now treat the address as email and remove the name.

This fixes downstream users that rely on email to show email
addresses and don't expilicity handle this case.

E.g. A userid foo@example.com was:
uid->name = "foo@example.com"
uid->email = ""
uid->address = "foo@example.com"

It is now:
uid->name = ""
uid->email = "foo@example.com"
uid->address = "foo@example.com"
src/key.c