Fix autodiscover when attempted with Exchange 2003 server
* Make sure 403 error in autodiscover isn't treated as an auth error
(401 is used for that)
* Make non-auth errors in autodiscover fail silently (and move user
to manual setup)
Bug: 2374302
Change-Id: I4699bff70cf5ec4a513e6443e4817543c2ab2cef
diff --git a/src/com/android/exchange/EasSyncService.java b/src/com/android/exchange/EasSyncService.java
index 20c32e6..e8a35eb 100644
--- a/src/com/android/exchange/EasSyncService.java
+++ b/src/com/android/exchange/EasSyncService.java
@@ -321,7 +321,9 @@
userLog("Posting autodiscover to redirect: " + post.getURI());
return client.execute(post);
}
- } else if (isAuthError(code)) {
+ } else if (code == HttpStatus.SC_UNAUTHORIZED) {
+ // 401 (Unauthorized) is for true auth errors when used in Autodiscover
+ // 403 (and others) we'll just punt on
throw new MessagingException(MessagingException.AUTHENTICATION_FAILED);
} else if (code != HttpStatus.SC_OK) {
// We'll try the next address if this doesn't work