aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Dmitry Isaikin <isaikin-dmitry@yandex.ru>2016-05-11 19:29:22 +0300
committerGravatar HoĆ  V. DINH <dinh.viet.hoa@gmail.com>2016-05-11 09:29:22 -0700
commitf0af8ad158b559b12063be902a5ee6114c4b0a7c (patch)
treedaeec927c3f1e9076a6b59c5e851bff2e2057e16
parent96a217a200b3201616fe0be6063ad488752f796f (diff)
Automaticaly enable Rambler workaround when we are downloading attachment with base64 or uuencode encoding (#1423)
-rwxr-xr-xsrc/core/imap/MCIMAPSession.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/core/imap/MCIMAPSession.cpp b/src/core/imap/MCIMAPSession.cpp
index 48491121..f564a435 100755
--- a/src/core/imap/MCIMAPSession.cpp
+++ b/src/core/imap/MCIMAPSession.cpp
@@ -2826,10 +2826,20 @@ Data * IMAPSession::fetchMessageAttachment(String * folder, bool identifier_is_u
section = mailimap_section_new_part(section_part);
fetch_att = mailimap_fetch_att_new_body_peek_section(section);
fetch_type = mailimap_fetch_type_new_fetch_att(fetch_att);
-
+
+#ifdef LIBETPAN_HAS_MAILIMAP_RAMBLER_WORKAROUND
+ if ((encoding == EncodingBase64 || encoding == EncodingUUEncode) && (mHostname->compare(MCSTR("imap.rambler.ru")) == 0)) {
+ mailimap_set_rambler_workaround_enabled(mImap, 1);
+ }
+#endif
+
r = fetch_imap(mImap, identifier_is_uid, identifier, fetch_type, &text, &text_length);
mailimap_fetch_type_free(fetch_type);
-
+
+#ifdef LIBETPAN_HAS_MAILIMAP_RAMBLER_WORKAROUND
+ mailimap_set_rambler_workaround_enabled(mImap, 0);
+#endif
+
mProgressCallback = NULL;
MCLog("had error : %i", r);