mirror of
https://github.com/moparisthebest/davmail
synced 2025-02-28 17:31:52 -05:00
EWS: fix 3190774, LDAP galfind email address handling, use Mailbox value instead of EmailAddress1/2/3
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1643 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
286a0929b1
commit
367c57b60b
@ -1758,9 +1758,7 @@ public class EwsExchangeSession extends ExchangeSession {
|
||||
GALFIND_ATTRIBUTE_MAP.put("cn", "DisplayName");
|
||||
GALFIND_ATTRIBUTE_MAP.put("givenName", "GivenName");
|
||||
GALFIND_ATTRIBUTE_MAP.put("sn", "Surname");
|
||||
GALFIND_ATTRIBUTE_MAP.put("smtpemail1", "EmailAddress1");
|
||||
GALFIND_ATTRIBUTE_MAP.put("smtpemail2", "EmailAddress2");
|
||||
GALFIND_ATTRIBUTE_MAP.put("smtpemail3", "EmailAddress3");
|
||||
GALFIND_ATTRIBUTE_MAP.put("smtpemail1", "EmailAddress");
|
||||
|
||||
GALFIND_ATTRIBUTE_MAP.put("roomnumber", "OfficeLocation");
|
||||
GALFIND_ATTRIBUTE_MAP.put("street", "BusinessStreet");
|
||||
@ -1798,7 +1796,7 @@ public class EwsExchangeSession extends ExchangeSession {
|
||||
if (LOGGER.isDebugEnabled()) {
|
||||
for (String key : response.keySet()) {
|
||||
if (!IGNORE_ATTRIBUTE_SET.contains(key) && !GALFIND_ATTRIBUTE_MAP.containsValue(key)) {
|
||||
LOGGER.debug("Unsupported ResolveNames in " + contact.getName() + " response attribute: " + key + " value: " + response.get(key));
|
||||
LOGGER.debug("Unsupported ResolveNames " + contact.getName() + " response attribute: " + key + " value: " + response.get(key));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -70,6 +70,8 @@ public class ResolveNamesMethod extends EWSMethod {
|
||||
String tagLocalName = reader.getLocalName();
|
||||
if ("Name".equals(tagLocalName)) {
|
||||
responseItem.put(tagLocalName, XMLStreamUtil.getElementText(reader));
|
||||
} else if ("EmailAddress".equals(tagLocalName)) {
|
||||
responseItem.put(tagLocalName, XMLStreamUtil.getElementText(reader));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -99,7 +101,7 @@ public class ResolveNamesMethod extends EWSMethod {
|
||||
if (XMLStreamUtil.isStartTag(reader)) {
|
||||
String tagLocalName = reader.getLocalName();
|
||||
String value = XMLStreamUtil.getElementText(reader);
|
||||
responseItem.put(addressType+tagLocalName, value);
|
||||
responseItem.put(addressType + tagLocalName, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -138,12 +140,16 @@ public class ResolveNamesMethod extends EWSMethod {
|
||||
if (XMLStreamUtil.isStartTag(reader)) {
|
||||
String tagLocalName = reader.getLocalName();
|
||||
if ("Entry".equals(tagLocalName)) {
|
||||
String key = getAttributeValue(reader, "Key");
|
||||
String value = XMLStreamUtil.getElementText(reader);
|
||||
if (value != null && (value.startsWith("smtp:") || value.startsWith("SMTP:"))) {
|
||||
value = value.substring(5);
|
||||
if (value != null) {
|
||||
if (value.startsWith("smtp:") || value.startsWith("SMTP:")) {
|
||||
value = value.substring(5);
|
||||
// get smtp address only if not already available through Mailbox info
|
||||
if (responseItem.get("EmailAddress") == null) {
|
||||
responseItem.put("EmailAddress", value);
|
||||
}
|
||||
}
|
||||
}
|
||||
responseItem.put(key, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user