1
0
mirror of https://github.com/moparisthebest/davmail synced 2025-01-12 14:08:38 -05:00

store actual user alias in ExchangeSession

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@435 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2009-03-13 11:11:40 +00:00
parent 4cce79f0c9
commit 25722a10b4

View File

@ -96,6 +96,7 @@ public class ExchangeSession {
*/
private String mailPath;
private String email;
private String alias;
private WebdavResource wdr = null;
private final ExchangeSessionFactory.PoolKey poolKey;
@ -1743,18 +1744,22 @@ public class ExchangeSession {
public void buildEmail(String methodPath) throws IOException {
// first try to get email from login name
email = getEmail(getAliasFromLogin());
alias = getAliasFromLogin();
email = getEmail(alias);
// failover: use mailbox name as alias
if (email == null) {
email = getEmail(getAliasFromMailPath());
alias = getAliasFromMailPath();
email = getEmail(alias);
}
// another failover : get alias from mailPath display name
if (email == null) {
email = getEmail(getAliasFromMailboxDisplayName());
alias = getAliasFromMailboxDisplayName();
email = getEmail(alias);
}
if (email == null) {
// failover : get email from Exchange 2007 Options page
email = getEmail(getAliasFromOptions(methodPath));
alias = getAliasFromOptions(methodPath);
email = getEmail(alias);
}
if (email == null) {
throw new IOException("Unable to get user email with alias " + getAliasFromLogin()
@ -1808,6 +1813,15 @@ public class ExchangeSession {
return email;
}
/**
* Get current user alias
*
* @return user email
*/
public String getAlias() {
return alias;
}
/**
* Search users in global address book
*