diff options
author | Viet Hoa Dinh <dinh.viet.hoa@gmail.com> | 2016-07-24 07:16:50 +0900 |
---|---|---|
committer | Viet Hoa Dinh <dinh.viet.hoa@gmail.com> | 2016-07-24 07:17:12 +0900 |
commit | 7eeb60a8b42cddcd4e61d299c8037cbb22eb63ba (patch) | |
tree | 9be7ae31f34d7c5ae754c9cbbfedcbb82353eaa2 | |
parent | 3c37b36e6522c777e482292c7818d71612426519 (diff) |
Disable namespace for Hermes servers (fixed #1471)
-rw-r--r-- | src/core/imap/MCIMAPSession.cpp | 11 | ||||
-rw-r--r-- | src/core/imap/MCIMAPSession.h | 1 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/core/imap/MCIMAPSession.cpp b/src/core/imap/MCIMAPSession.cpp index 67ff7341..5bbdf379 100644 --- a/src/core/imap/MCIMAPSession.cpp +++ b/src/core/imap/MCIMAPSession.cpp @@ -396,6 +396,7 @@ void IMAPSession::init() mFirstUnseenUid = 0; mYahooServer = false; mRamblerRuServer = false; + mHermesServer = false; mLastFetchedSequenceNumber = 0; mCurrentFolder = NULL; pthread_mutex_init(&mIdleLock, NULL); @@ -715,6 +716,7 @@ void IMAPSession::connect(ErrorCode * pError) mNamespaceEnabled = true; } mRamblerRuServer = (mHostname->locationOfString(MCSTR(".rambler.ru")) != -1); + mHermesServer = (mWelcomeString->locationOfString(MCSTR("Hermes")) != -1); } mState = STATE_CONNECTED; @@ -4227,8 +4229,13 @@ void IMAPSession::applyCapabilities(IndexSet * capabilities) if (capabilities->containsIndex(IMAPCapabilityXOAuth2)) { mXOauth2Enabled = true; } - if (capabilities->containsIndex(IMAPCapabilityNamespace)) { - mNamespaceEnabled = true; + if (mHermesServer) { + // Hermes server improperly advertise a namespace capability. + } + else { + if (capabilities->containsIndex(IMAPCapabilityNamespace)) { + mNamespaceEnabled = true; + } } if (capabilities->containsIndex(IMAPCapabilityCompressDeflate)) { mCompressionEnabled = true; diff --git a/src/core/imap/MCIMAPSession.h b/src/core/imap/MCIMAPSession.h index 4d1f3894..0fb93c42 100644 --- a/src/core/imap/MCIMAPSession.h +++ b/src/core/imap/MCIMAPSession.h @@ -271,6 +271,7 @@ namespace mailcore { uint32_t mFirstUnseenUid; bool mYahooServer; bool mRamblerRuServer; + bool mHermesServer; unsigned int mLastFetchedSequenceNumber; String * mCurrentFolder; |