Subject: bug#17720: 24.3; EUDC LDAP duplicate mail handling broken.

From: "Raimund Berger" <[email-masked]>
Date: Fri, 06 Jun 2014 19:51:33 +0200

Hi there,

EUDC - and this seems to be a long standing issue - doesn't properly
recognize and handle LDAP entries that have multiple "mail" records.

Example: when having an LDAP entry with cn "John Doe" and two mail
records "[email-masked]" "[email-masked]" the corresponding inline expansion
LDAP call returns

 ((cn . "John Doe") (mail . "[email-masked]") (mail . "[email-masked]"))

given the setting
 (eudc-protocol-set 'eudc-inline-expansion-format '("%s <%s>" cn email) 'ldap)

and eudc-duplicate-attribute-handling-method having its default value
((email . duplicate)).

The above list is then passed into eudc-filter-duplicate-attributes,
which unfortunately fails to properly handle or even just recognize
those duplicate "mail" records. This failure then results into inline
expansion just inserting the first mail entry instead of offering a
selection between all available mail records, like it properly happens
with the bbdb backend for example.

Unfortunately, I don't know enough of elisp to maybe fix the issue
myself (all the mapcars, cdrs, etc make me dizzy). But it would be great
if this issue could be dealt with.

I've seen several complaints about this matter on the net btw, one
dating back to 2005. So it seems to be an old one.

Thanks, R.

In GNU Emacs 24.3.1 (i686-pc-linux-gnu, GTK+ Version 2.24.10)
 of 2014-05-18 on gigli