aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Dmitry Isaikin <isaikin-dmitry@yandex.ru>2016-09-19 08:56:03 +0400
committerGravatar HoĆ  V. DINH <dinh.viet.hoa@gmail.com>2016-09-18 21:56:03 -0700
commit2a07d182fff49f453f845298101bea7531da40f2 (patch)
tree0225a76e51c257ed0ed08f0088e27d48d315eb60
parentf708ce74e23b61ec6e5ae958eba0b8bcd8831a1e (diff)
Enable workaround for QIP IMAP server (#1512)
-rw-r--r--src/core/imap/MCIMAPSession.cpp13
-rw-r--r--src/core/imap/MCIMAPSession.h1
2 files changed, 14 insertions, 0 deletions
diff --git a/src/core/imap/MCIMAPSession.cpp b/src/core/imap/MCIMAPSession.cpp
index 5bbdf379..4cfcfa95 100644
--- a/src/core/imap/MCIMAPSession.cpp
+++ b/src/core/imap/MCIMAPSession.cpp
@@ -397,6 +397,7 @@ void IMAPSession::init()
mYahooServer = false;
mRamblerRuServer = false;
mHermesServer = false;
+ mQipServer = false;
mLastFetchedSequenceNumber = 0;
mCurrentFolder = NULL;
pthread_mutex_init(&mIdleLock, NULL);
@@ -717,6 +718,7 @@ void IMAPSession::connect(ErrorCode * pError)
}
mRamblerRuServer = (mHostname->locationOfString(MCSTR(".rambler.ru")) != -1);
mHermesServer = (mWelcomeString->locationOfString(MCSTR("Hermes")) != -1);
+ mQipServer = (mWelcomeString->locationOfString(MCSTR("QIP IMAP server")) != -1);
}
mState = STATE_CONNECTED;
@@ -3921,6 +3923,13 @@ void IMAPSession::storeFlagsAndCustomFlags(String * folder, bool identifier_is_u
store_att_flags = mailimap_store_att_flags_new_set_flags_silent(flag_list);
break;
}
+
+#ifdef LIBETPAN_HAS_MAILIMAP_QIP_WORKAROUND
+ if (mQipServer) {
+ mailimap_set_qip_workaround_enabled(mImap, 1);
+ }
+#endif
+
if (identifier_is_uid) {
r = mailimap_uid_store(mImap, current_set, store_att_flags);
}
@@ -3928,6 +3937,10 @@ void IMAPSession::storeFlagsAndCustomFlags(String * folder, bool identifier_is_u
r = mailimap_store(mImap, current_set, store_att_flags);
}
+#ifdef LIBETPAN_HAS_MAILIMAP_QIP_WORKAROUND
+ mailimap_set_qip_workaround_enabled(mImap, 0);
+#endif
+
if (r == MAILIMAP_ERROR_STREAM) {
mShouldDisconnect = true;
* pError = ErrorConnection;
diff --git a/src/core/imap/MCIMAPSession.h b/src/core/imap/MCIMAPSession.h
index 0fb93c42..59623537 100644
--- a/src/core/imap/MCIMAPSession.h
+++ b/src/core/imap/MCIMAPSession.h
@@ -272,6 +272,7 @@ namespace mailcore {
bool mYahooServer;
bool mRamblerRuServer;
bool mHermesServer;
+ bool mQipServer;
unsigned int mLastFetchedSequenceNumber;
String * mCurrentFolder;