diff --git a/src/java/davmail/exchange/ews/EwsExchangeSession.java b/src/java/davmail/exchange/ews/EwsExchangeSession.java index 33ccc455..c0982764 100644 --- a/src/java/davmail/exchange/ews/EwsExchangeSession.java +++ b/src/java/davmail/exchange/ews/EwsExchangeSession.java @@ -1691,6 +1691,7 @@ public class EwsExchangeSession extends ExchangeSession { Contact contact = new Contact(); contact.setName(response.get("Name")); contact.put("imapUid", response.get("Name")); + contact.put("uid", response.get("Name")); if (LOGGER.isDebugEnabled()) { for (String key : response.keySet()) { if (!IGNORE_ATTRIBUTE_SET.contains(key) && !GALFIND_ATTRIBUTE_MAP.containsValue(key)) { diff --git a/src/java/davmail/ldap/LdapConnection.java b/src/java/davmail/ldap/LdapConnection.java index 23d3005c..002895c8 100644 --- a/src/java/davmail/ldap/LdapConnection.java +++ b/src/java/davmail/ldap/LdapConnection.java @@ -1369,7 +1369,7 @@ public class LdapConnection extends AbstractConnection { // full search for (char c = 'A'; c <= 'Z'; c++) { if (!abandon && persons.size() < sizeLimit) { - for (ExchangeSession.Contact person : session.galFind(session.startsWith("imapUid", String.valueOf(c)), + for (ExchangeSession.Contact person : session.galFind(session.startsWith("cn", String.valueOf(c)), convertLdapToContactReturningAttributes(returningAttributes), sizeLimit).values()) { persons.put(person.get("uid"), person); if (persons.size() == sizeLimit) {