EWS: improved email/alias failover fix

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1592 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2011-01-04 20:46:29 +00:00
parent 10f82dc08d
commit ef7cfae687
1 changed files with 4 additions and 6 deletions

View File

@ -152,7 +152,9 @@ public class EwsExchangeSession extends ExchangeSession {
method.releaseConnection(); method.releaseConnection();
// need to retrieve email and alias // need to retrieve email and alias
getEmailAndAliasFromOptions(); getEmailAndAliasFromOptions();
} else { }
if (email == null || alias == null) {
// OWA authentication failed, get email address from login // OWA authentication failed, get email address from login
if (userName.indexOf('@') >= 0) { if (userName.indexOf('@') >= 0) {
// userName is email address // userName is email address
@ -171,12 +173,8 @@ public class EwsExchangeSession extends ExchangeSession {
} }
} }
if (email == null || alias == null) {
throw new DavMailAuthenticationException("EXCEPTION_EWS_NOT_AVAILABLE");
}
currentMailboxPath = "/users/" + email.toLowerCase(); currentMailboxPath = "/users/" + email.toLowerCase();
// nothing to do, mailPath not used in EWS mode
// check EWS access // check EWS access
try { try {
checkEndPointUrl("/ews/exchange.asmx"); checkEndPointUrl("/ews/exchange.asmx");